You ask either guard, “If I were to ask the other guard which door leads to freedom, what would he say?” Then, you take the opposite door. The truthful guard will point to the wrong door (because the other would lie), and the liar would also point to the wrong door (because the truthful guard would tell the truth).