Based on the bible, war must be the last resort, after all alternatives have failed. A lawful authority must authorize the military action, and that authority must be driven by an intention to establish peace not to gain territory or claim the goods of another nation. Any military action must be proportionate to the good that can be gained. No military action is justified that is not absolutely necessary. There must also be a very real hope of success.
In conclusion, the only justifiable war is defensive rather than offensive, not to gain an advantage.