Burayda bin Husayb reported,

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.

Azami 7901

Sahih

عن بريدة بن الحصيب قال

كان رسول الله ﷺ إذا أمرأميرا على جيش أو سرية أوصاه في خاصته بتقوى الله ومن معه من المسلمين خيرا ثم قال: اغزوا باسم الله في سبيل الله، قاتلوا من كفر بالله، اغزوا ولا تغلوا، ولا تغدروا، ولا تمثلوا، ولا تقتلوا وليدا… الحديث

الأعظمي 7901صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Jihad
Chapter
Rulings on jihad and its etiquette
Section
Prohibition of killing children and women in war
Numbering
Jami al-Kamil 7901 (2nd edition)
Azami 7901