It wasnarrated from Ibn Buraidah that his father said:
"Whenever heappointed a man to lead a military detachment, the Messenger of Allah(ﷺ) would advise him especially to fear Allah and treat the Muslimswith him well. He (ﷺ) said: 'Fight in the Name of Allah and inthecause of Allah. Fight those how disbelieve in Allah. Fight but donotbe treacherous, do not steal from the spoils of war, do notmutilateand do not kill children. When you meet your enemy fromamong thepolytheists, call them to one of three things. Whichever ofthem theyrespond to, accept it from them and refrain from fightingthem. Invitethem to accept Islam, and if they respond then accept itfrom them andrefrain from fighting them. Then invite them to leavetheir land andmove to the land of the polytheists. Tell them that ifthey do that,then they will have the same rights and duties as thepolytheists. Ifthey refuse, then tell them that they will be likethe Muslim Bedouins(who live in the desert), subject to the samerulings of Allah as thebelievers. But they will have no share ofFay'* or war spoils, unlessthey fight alongside the Muslims. Ifthey refuse to enter Islam, thenask them to pay the Poll-tax. Ifthey do that, then accept it fromthem and refrain from fightingthem. But if they refuse, then seek thehelp of Allah against themand fight them. If you lay siege to themand they want you to givethem the protection of Allah and yourProphet, do not give them theprotection of Allah and your Prophet,rather give them yourprotection and the protection of your father andyour Companions, forif you violate your protection and the protectionof your fathers,that is easier than violating the protection of Allahand theprotection of His Messenger. If you lay siege to them and theywantyou to let them come out with a promise of the judgement of AllahandHis Messenger (ﷺ), do not offer them a promise of the judgementofAllah and His Messenger (ﷺ), rather offer them your judgement,because you do not know if you will actually pass (the same as)Allah's judgement regarding them or not.'"
English reference: Vol. 4, Book 24, Hadith 2858
Arabic reference: Book 24, Hadith 2967