I think the answer would be to make the statement "You will behead me".
if they decide to behead him, then he would have said the truth, which means that he would need to be hanged.
But if they try to hang him for telling the truth, he would have lied, and should have been beheaded.