The Prophet ﷺ instructed his armies: 'Do not betray, do not mutilate, do not kill a child.' His successor Abu Bakr told the army commander not to kill women, children and the elderly, not to cut down fruit trees, not to slaughter a sheep except for food and to leave the monks alone. Torture and burning with fire are forbidden, prisoners must be fed and treated humanely and treaties must be kept.
The Quran tells Muslims to fight only those who fight them, not to transgress limits, and to accept peace when it is offered. Muslim scholars used these rules to condemn terrorism and the killing of civilians, which are far from the rules of war in Islam. Muslims admit that their armies have not always followed these rules, but the rules are clear.