Burayda reported,

Whenever the Messenger of Allah ﷺ appointed a commander over an army or a raiding party, he would personally enjoin upon him the fear of Allah and instruct him to treat the Muslims accompanying him well. Then he would say, "Fight in the name of Allah, in the path of Allah. Fight those who disbelieve in Allah. Go forth to battle, but do not embezzle from the spoils, do not act treacherously, do not mutilate the dead, and do not kill a child.When you meet your enemy from among the polytheists, call them to three options. Whichever of them they accept, accept it from them and refrain from fighting them.First, call them to Islam. If they accept, accept it from them and refrain from fighting them. Then call them to relocate from their land to the land of the Muhajirin, and inform them that if they do so, they will have the same rights as the Muhajirin and the same obligations. If they refuse to relocate from their land, inform them that they will be like the Bedouin Muslims, subject to the same rule of Allah that applies to all believers, but they will have no share of the spoils of war or fay, unless they fight alongside the Muslims.If they refuse, then ask them to pay the jizya. If they accept, accept it from them and refrain from fighting them. If they refuse, then seek the help of Allah and fight them.When you besiege the people of a fortress and they want you to grant them the protection of Allah and the protection of His Prophet, do not grant them the protection of Allah nor the protection of His Prophet. Rather, grant them your own protection and the protection of your companions, for it is a lesser matter if you violate your own protection and that of your companions than if you violate the protection of Allah and His Messenger.When you besiege the people of a fortress and they want you to bring them down according to the judgment of Allah, do not bring them down according to the judgment of Allah. Rather, bring them down according to your own judgment, for you do not know whether you will hit upon Allah's judgment regarding them or not."

Azami 12425

Sahih

عن بريدة قال

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

الأعظمي 12425صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Tafsir of the great Quran
Chapter
Virtues of Surah Baqarah
Section
His saying, "Indeed, those who believed and emigrated and strove with their wealth and their lives in the cause of Allah, and those who gave shelter and aided, they are allies of one another. And those who believed but did not emigrate, you have no guardianship of them until they emigrate. And if they seek your help in religion, then you must help them, except against a people between whom and you there is a treaty. And Allah is seeing of what you do." His saying, "They are allies of one another"
Numbering
Jami al-Kamil 12425 (2nd edition)
Azami 12425