Lie detectors are not always accurate. There was one employee who stole continually and passed the lie detector test 14 times! Others of us who worked with her became so nervous with the bands of the machine that were so tight on our bodies that we nearly failed.
Aside from the moral aspects of falsehoods, if one lies, one risks destroying his/her credibility and may never henceforth be believed. Also, if one tells the truth, it is not difficult to remember what he/she has done or said, so if an issue presents itself, the person can relax and be assured of coming out of a difficult situation. In the long way, life is easier if one tells the truth. The quote about the "tangled web" is so true.
I once had to take a lie detector test, and it was one of the most intimidating experiences of my life. There was some theft going on at work; though I didn't know it at the time, it was happening right after my shift. (The gal working after me was taking cash and the lie detector proved it, by the way.) I just knew some of us were scheduled to take the test, and it was serious business. To be perfectly honest, I have no idea how I passed the test because it was just so nerve-wracking--and I was innocent! My advice: don't lie.
The obvious answer is to not lie while taking the lie detector test. As mentioned above some people think that they can fool the lie detector by controlling breathing and other body functions or by destroying the baseline when asked the qualifying questions. While the machines may be able to be fooled, the people administering the test are probably harder to fool.
Well, "lie detectors", also known as polygraph machines, are simply devices that measure biological responses to questions/responses. Because the biological signals a body gives off - heart rate, respiration, etc. are different when a person is being untruthful, people who administer the test have methods for determining whether they believe someone is answering questions honestly or not.
These test results are not admissible in court, because they are not wholly reliable. Usually, police only use them to determine if a person is worth invesigating further. Employers also use them to screen prospective employees, and the government often uses them to screen who is qualified for a security clearance.
As for your question, the easiest way to "escape" being caught is to tell the truth. Some believe you can mislead the machine by destroying the baseline, that is, when they ask you questions about your name, address, etc., they are establishing what your normal reactions are to telling the truth, then questions you answer truthfully should have similar signals. They train CIA agents in tactics that can mirror a truthful baseline, such as stepping on a thumbtack every time they ask you a baseline question, so that a stressful reaction to the pain looks like a truthful baseline. I wouldn't rely on that method though.