The Hebrew verb translated here for “to kill” in the 6th Commandment is rare in the Hebrew Bible.  It is never used for killing in war or for capital punishment.   Therefore, a more accurate translation may be “Thou shalt not kill another Hebrew.”  For more information see Peter Craige, The Problem of War in the Old Testament (Eerdmans, 1978).