As for the enemy soldier: if he is engaged in agression, he is committing an objectively wrong act, and needs to be stopped. In this case, the intent is to stop him, not to kill him per se, and that can be proved by the fact that if you injure him and then capture him, you cannot kill him at that point. He has been stopped: to kill him would be murder.
How could someone really determine what state of mind a dead person was in when they committed suicide?
What about bombing soldiers from 20000ft behind the front lines? How would you know whether they were acting aggressively or not? Do snipers commit murder when they shoot someone from 800yds, that’s walking out of a building?
There’s an if at the beginning of each example. Who determines the if?