I was an infantryman. If I did that to an enemy soldier it would be a war crime.
Under certain circumstances, perhaps. However, it is generally permissible and legal to shoot enemy soldiers in the back. Until they surrender, they are enemy combatants. Whether that soldier is running away to cry in a fighting hole or whether he is running away to pick up a weapon or to regroup and mount a counterattack is unknown. If he is an combatant and he has not surrendered, you can shoot him (direction of travel and body orientation is irrelevant). If shooting someone in the back was sufficient for a war crime and I was a foe of the United States, why would I not just turn my back towards US warfighters anytime I got into a firefight with them if things were not looking favorable to me?
You can also shoot paratroopers from the sky. You cannot shoot pilots who have ejected from their aircraft unless they are exhibiting hostile intent/act such as shooting at you as they are floating to earth. You cannot target religious buildings, but if the enemy uses them, those structures lose their protected status. Also, enemy combatants need not possess firearms to be legitimate targets. A wounded soldier soldier without any firearm, but in possession of a radio has the potential to call for fire and can be shot. And yes, contrary to the ridiculous rumor, you can shoot enemy combatants with a .50BMG.
While there are specific rules of engagement, depending on your area of operations, the above examples hold true in most cases.
Also, I am not advocating shooting anyone in the back. I am simply illustrating that it is, generally, legally permissible in war to do so. If an enemy does not want to be shot, his best option is to lay down his arms, radios, and surrender. Shooting someone after they have done so would likely result in you being charged with a war crime.
In fact, continuing pursuit of an enemy attempting to escape is one of the offensive operations outlined on page 104 of Marine Corps Doctrinal Publication (MCDP) 1-3.