Whenever the Messenger of Allah ﷺ appointed a commander over an army or a raiding party, he would personally instruct him to be mindful of Allah and to treat the Muslims accompanying him well. Then he would say, "Fight in the name of Allah and in the path of Allah. Fight those who disbelieve in Allah. Go forth to battle, but do not steal from the spoils, do not break your pledges, do not mutilate the dead, and do not kill a child..." and the hadith continues.
كان رسول الله ﷺ إذا أمرأميرا على جيش أو سرية أوصاه في خاصته بتقوى الله ومن معه من المسلمين خيرا ثم قال: اغزوا باسم الله في سبيل الله، قاتلوا من كفر بالله، اغزوا ولا تغلوا، ولا تغدروا، ولا تمثلوا، ولا تقتلوا وليدا… الحديث