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."
أخبرنا محمد بن حاتم بن نعيم قال أنبأنا حبان قال حدثنا عبد الله عن حميد بن الطويل
أن رسول الله ﷺ قال أمرت أن أقاتل الناس حتى يشهدوا أن لا إله إلا الله وأن محمدا رسول الله فإذا شهدوا أن لا إله إلا الله وأن محمدا رسول الله واستقبلوا قبلتنا وأكلوا ذبيحتنا وصلوا صلاتنا فقد حرمت علينا دماؤهم وأموالهم إلا بحقها لهم ما للمسلمين وعليهم ما عليهم
Bukhari narrated it in the Book of Prayer, Chapter on the merit of facing the qibla, hadith no. 392, from the hadith of Abdullah bin Mubarak, with this same wording. It is also found in his Musnad, hadith no. 255, and in Al-Kubra, hadith no. 3429, and it will come again, hadith no. 5006.