That passage needs lots of interpretation to make sense out of it.
It would be interesting to hear a Jewish interpretation , in the context of soldiers killing.
The part that needs most interpretation, is why the last 7 words are there.
The verse in question has nothing to do with war and soldiers. It is a very early version of the lex talionis, and refers to the legal custom in ancient times of murder or manslaughter necessitating the clan of the victim to appoint a designated blood avenger who would find the victim's slayer and kill them, which was in earliest times considered justice. The idea was that blood paid for blood. The justification for this verse (that people are created in God's image) is twofold: first, and more importantly, people ought not to murder one another at all, because we should all respect the fact that we are equally images of our Creator; second, that when murders do occur, we have every right to bring the guilty to justice, even if that means killing them, because as images of God, we have been given a share of His authority and justice, and have the vested power to make an orderly and just society, even if that means executing the guilty.
(By the way, it is probably worth repeating the often-overlooked fact that there is no prohibition in the Bible, or in Jewish Law, against killing. What is prohibited is unjustified and illicit homicide. Even the Sixth Commandment, which is usually mistranslated as "Thou shalt not kill," does not say that. It says
lo tirtzach, which means "Do no murder." Jewish text is quite clear in establishing nuances of legality, that there are murders which are prohibited, and there is killing, which is potentially justifiable.)
There is, in fact, very little support to be found in the Tanakh for the notion that God might prohibit or proscribe wars or soldiery. Israelite Judaism existed in a world where people fought often, and wars were a matter of course. What there is support for is the idea that there ought to be limits, even in war. For example, the only genocide the Israelites were actually commanded to do was against Amalek; and this was justified by Amalek having attacked the People Israel during the wanderings in the wilderness after the Exodus-- but more specifically, that Amalek attacked from the rear, hitting the aged, infirm, women, and children first. Amalek's unforgivable sin is attacking noncombatants as a demoralizing and diversionary tactic.
There are also commandments in Deuteronomy proscribing using environmental disaster as a weapon of war (e.g., one may not cut down fruit trees in order to build seige weaponry, nor may one salt the earth of one's enemy), and preventing battlefield rape (Israelite men were permitted to take a woman captive, but could not simply rape her and discard her: they had to take her home, permit her a month of mourning and weeping for her family, and then formally marry her, with full rights of divorce; which would have greatly discouraged capturing women at all, since it almost certainly would have been seen as too much trouble). Interestingly, there is also a commandment in Deuteronomy that indicates that armies should consist of volunteers of established adult citizens: minors, the newly married, those with newly-finished houses, conscripts who are afraid to fight-- all are supposed to be sent home.
From a Jewish point of view, the OP question of this thread is far too vague to answer without qualification. "Does God forgive soldiers..." for what? Merely for killing the enemy in war? That isn't forbidden. For killing to defend themselves? In Jewish Law, one must kill to defend oneself. But if the question is, "Does God forgive soldiers" for deliberately killing civilian noncombatants? Maybe not. "Does God forgive soldiers" for battlefield rape? Maybe not. The Bible may regard war as an unfortunate inevitability, but it absolutely does advocate there being rules of war, and moral limits even in emergencies and unusual circumstances.