Maimonides, Hilchot Melachim 85, Ch 5:1
A king should not initiate war unless it is an Obligatory War. And what is an Obligatory War? This is a war against the seven nations (see Deut. 7:1), a war against Amalek, or a war to assist the people of Israel from trouble that has come upon them (see Num. 10:9). One may also fight a Permitted War, a war fought to expand the borders of Israel or to increase [the king's] greatness and reputation.
Maimonides, Hilchot Melachim 86, Ch. 6:1
One should not make war against anyone without first calling out to them for peace, whether in the case of a Permitted War or an Obligatory War; as it is written: "When you come upon a city to make war upon it, you shall call out to it for peace." (Deut. 20:10).