On the authority of Buraidah — may Allah be pleased with him — who said: Whenever the Messenger of Allah ﷺ appointed a commander over an army or a detachment (sarīyya), he would admonish him to fear Allah Most High and to treat the Muslims under his command well. He would then say:
“March in the name of Allah, upon the path of Allah. Fight those who deny Allah. Advance, but do not embezzle (from the booty), 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 courses of action. Whichever of the three they accept, accept it from them and cease fighting them.
First, invite them to Islam; if they respond, accept it from them.
Then invite them to migrate from their dwelling place to the abode of the Emigrants (muhājirūn). Tell them that if they do so, they will enjoy the same rights and bear the same duties as the Emigrants. If they refuse to migrate, inform them that they will be like the nomadic Muslims: Allah’s ruling for believers will apply to them, but they will have no share in the spoils or booty unless they fight alongside the Muslims.
If they refuse that, then ask them to pay the jizyah (tribute). If they agree, accept it from them and refrain from fighting them. If they decline, seek Allah’s help and fight them.
And when you besiege the people of a fortress and they ask you to grant them the pledge of protection (dhimmah) of Allah and His Messenger, do not grant them the pledge of Allah and His Messenger; rather, grant them your own pledge and that of your companions, for it is less serious that you break your own pledge and that of your companions than that you break the pledge of Allah and His Messenger.”