Anas bin Malik reported,

The Messenger of Allah ﷺ said, "I have been commanded to fight people until they bear witness that there is no god but Allah and that Muhammad is the Messenger of Allah. When they bear witness that there is no god but Allah and that Muhammad is the Messenger of Allah, face our qiblah, eat what we slaughter, and pray as we pray, then their blood and property become forbidden to us except by right. They have the same rights as the Muslims and the same obligations."

Nasai 5006

Sahih

أخبرنا محمد بن حاتم بن نعيم قال أنبأنا حبان قال أنبأنا عبد الله عن حميد الطويل

عن أنس بن مالك

أن رسول الله ﷺ قال أمرت أن أقاتل الناس حتى يشهدوا أن لا إله إلا الله وأن محمدا رسول الله فإذا شهدوا أن لا إله إلا الله وأن محمدا رسول الله واستقبلوا قبلتنا وأكلوا ذبيحتنا وصلوا صلاتنا فقد حرمت علينا دماؤهم وأموالهم إلا بحقها لهم ما للمسلمين وعليهم ما عليهم

النسائي 5006صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Nasai Sughra
Book
Faith and its laws
Chapter
Ali, what he fights the people for
Numbering
Darussalam 5006
Nasai 5006