Leviticus 24:17
How can God say 'Thou shalt not kill' yet order and perform so many killings?
To understand this issue requires not only a study of the Hebrew, but an element of understanding of ANE law codes as well. There is no evidence that any collection of Near Eastern laws functioned as a written code that was applied by a strict method of exegesis to individual cases. They aided local courts without controlling them... Some laws are not open to interpretation (e.g. against idolatry), but as Jesus made clear, saving a life on the Sabbath was an 'exception'.
Our modern translations render the word 'murder' rather than 'kill'. The word ratsach... refers to any killing that is done in the manner of a predatory animal—which means either: 1. as an angry reaction to stimulus; or 2. lying in wait, as one waits for prey. Thus we have no difficulty or contradiction in Scripture with places where God declares judgment of death upon men.
Another verse which Skeptics appeal to is Leviticus 24:17. The word here is nakah. Nakah is used in the sense of striking or defeating. It does not strictly mean 'to kill' but is given that definition by context alone. Capital punishment and acts of judgment do not come under the rubric of ratsach because they are not done for predatory reasons.