Compulsive lying becomes habit, and is breakable. Requires two things to happen. First, lying HAS to have consequences. Second, truth has to have positive reinforcement. Consistancy is a must.
If your son is 3-6 years old, it may be a developmental stage that passes, or because he is afraid of what will happen. There is a balance between giving discipline and doing so in a way that is so scary a child is afraid to tell the truth.
Catch him in the act and ensure there are consequences for lying. Let him know he will lose privledges if he keeps lying, and follow through when you do catch him lying. Then stick to it and don't cave in.
If you realize that your son continues to lie to you repeatedly, then it is important for you to assert your authority as a parent and give him consequences so that he stops (for example, grounding, no cell phone, etc.)
You should explain to your son that lying is destructive because it makes others lost trust in him. Explain that he will be in more trouble if he lies.