The Messenger of Allah ﷺ said, "I have been commanded to fight the people until they say, 'There is no god but Allah.' When they say it, pray our prayer, face our qiblah, and slaughter as we slaughter, then their blood and property become inviolable to us except by right, and their reckoning is with Allah."
قال رسول الله ﷺ: أمرت أن أقاتل الناس حتى يقولوا: لا إله إلا الله، فإذا قالوها، وصلوا صلاتنا، واستقبلوا قبلتنا، وذبحوا ذبيحتنا فقد حرمت علينا دماؤهم وأموالهم إلا بحقها، وحسابهم على الله.
Bukhari reported it in the Book of Prayer (392) from Nuaym, who said, Ibn Mubarak narrated to us, from Humayd Tawil, from Anas bin Malik, who related it.