Murder is the most destructive and final crimes one person can commit against another.
In broad strokes there is general agreement in our country about what constitutes murder. There are times even in our country when we argue about whether something is murder or not.
Below are a few situations to consider.
If a person is attacked he has every right to protect himself even to the point of killing another. Killing is only allowed when the victim believes the attacker means to kill him.
It is permissible to kill someone who is pursuing another to kill them so long as this is the only way to stop them. If, however, it would have been possible to stop the pursuer by severely wounding him even to the point of destroying a limb this must be done. Anyone who kills a pursuer who could have been stopped without the use of lethal force is a murderer.
According to Laws of Kings and Their Wars 9:4 a person who directly places another person in peril is guilty of murder.
Abortion is not a permitted form of killing. As the Rambam states:
A gentile who slays any soul, even a fetus in its mother's womb, should be executed in retribution for its death.
--Laws of Kings and Their Wars 9:4
There are possible exceptions such as when the mother risks losing her life. A Rabbi learned in Noahide Law should be consulted under such scenarios.
It is forbidden to kill another human being even if that person will soon die on their own. The amount of pain a person is in does not alter this point. Killing another person is never a solution to a problem. This does not mean that a person must keep that person alive through artificial means. In scenarios such as this a Rabbi learned in Noahide Law should be consulted.
There are very few instances when it is justifiable to go to war with another group of people (such as a country). Some examples of just wars are: A country defends itself against the attacks of another country is justified in defending itself (such as the case with all of modern Israel's wars). When one people tries to steal the property of another people it is permissible to go on the offensive against the antagonist (As America did Against Iraq in the first Gulf War). To destroy a great evil as Jacob's sons did against Shechem (Genesis 34:25). When God directly commands one people to go to war against another people it is permissible to go to War. This was the case when God commanded Israel to go to war against the seven nations (Deuteronomy 20:17).
The above are individual examples of when killing in a war is permissible. However, even within the context of a justified war there are certain types of killing that are not permissible. An example of killing within war that is not justified is killing a prisoner who has surrendered.
Every war brings with it unexpected situations but it also brings with it scenarios that are clearly defined by halachah. A Noahide serving in the military of his country, serving as an official of the government who has the power to kill such as a police officer; ought to study the laws connected to killing. This is not to safeguard him against wrongful killing in the eyes of human courts, but to safeguard him against wrongful killing in the eyes of heaven.