if you happen to ask the guard that always lies he will tell you the door that leads to death (because he is lying about it being what the other guard would say) and if you ask the guard that tells the truth he would tell you the door that leads to death (because that is what the lying guard would actually say if you asked him which way was freedom) so either way you take the opposite door that the guard you asked said and it will go to freedom
-Darth Simon