I'm going to suggest something in between the two extremes put forth so far.
The soldier clearly killed the civilians, whether or not he was under mental duress or not is the only matter still up for debate. The appropriate action, although i doubt there is any precedent for this, would be to try him in a military court, with a military tribunal, military prosecution and military defendant, but the legal code he is to be charged under would be the Afghani one, (assuming they have a coherent legal system, which I rather doubt but am not really informed on).
Upon conviction, which I do not doubt would be the result in a fair court, he should receive the punishment dictated by the Afghan law, death. However we execute him, with lethal injection.
While obviously not everyone would be pleased I think it's enough of a compromise to to appease the majority of people, as well as satisfy Justice.