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 3972

Sahih

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

عن أنس بن مالك

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

النسائي 3972صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Nasai Sughra
Book
Prohibition of bloodshed
Chapter
Prohibition of bloodshed
Numbering
Darussalam 3972
Nasai 3972