The only law he was "convicted" of committing, and apparently after being tortured, and by a very dubious military council, was one created by the US after 9-11 which claims essentially that the US can invade your country and start a war and kill people legally, but if you defend yourself by killing an invader, you do so illegally. And under other US law, when you are accused of a crime, you are supposed to have access to a proper court, within a reasonable time period to defend yourself. He certainly didn't get that.