Whenever the Messenger of Allah ﷺ sent out his armies, he would say, "Set out in the name of Allah. You fight in the cause of Allah against those who disbelieve in Allah. Do not act treacherously, do not steal from the spoils, do not mutilate, do not kill children, and do not kill those who dwell in monasteries."
حدثنا أبو القاسم بن أبي الزناد قال أخبرني ابن أبي حبيبة عن داود بن الحصين عن عكرمة
كان رسول الله ﷺ إذا بعث جيوشه قال اخرجوا بسم الله تقاتلون في سبيل الله من كفر بالله لا تغدروا ولا تغلوا ولا تمثلوا ولا تقتلوا الولدان ولا أصحاب الصوامع
Its isnad is hasan. It appears in Majma al-Zawaid 5/316–317, where he attributed it to Ahmad, Abu Yaala, Bazzar, and Tabarani in Kabir and Awsat, then said, "Among the narrators of Bazzar is Ibrahim bin Ismail bin Abu Habibah. Ahmad deemed him trustworthy, while the majority declared him daif, and the rest of Bazzar's narrators are narrators of sahih!" I do not know why he directed his remark at Bazzar's narrators when he had before him the narrators of Musnad Ahmad?!The discussion of this isnad has already preceded in the hadith before this one.