On this point there is the ḥadith of Buraydah ibn al-Ḥuṣayb al-Aslamī, recorded in Ṣaḥīḥ Muslim. He said:
“Whenever the Prophet ﷺ placed someone in command of a detachment or an army, he would first counsel him, for his own sake, to fear Allah, and to treat the Muslims under him well. Then he would say:
‘Advance in the name of Allah, along the path of Allah. Fight those who deny Allah. Go forth, but do not misappropriate the spoils, do not act treacherously, do not mutilate, and do not kill a child. When you meet your enemy from among the polytheists, invite them to three alternatives; whichever of them they accept, accept it from them and cease hostilities.
First, call them to Islam; if they respond, accept it from them and halt your fighting.
Next, invite them to migrate from their land to the Abode of the Emigrants, and inform them that if they do so they will have the same rights and duties as the Emigrants. If they refuse to migrate, then tell them that they will be like the Muslim Bedouins…’