You can try to make your character more complex by giving him two different sides to his personality, but this may cause him to come across as a) an ambiguous person who can't make up his mind as to what he's really like, b) someone who is acting a part half the time (think Percy Blakeney, Bruce Wayne, or Diego de la Vega), or c) possibly even someone suffering from multiple personality disorder. Unless one of these options is your goal for your character, don't simply give him a double personality. Instead, build his personality in layers.
What a person is like on the surface is often not what he's like deeper down. For instance, many comedians are sad and depressed people in ordinary life. We all know how to put on a mask and wear it in public because we've learned that it makes things easier and safer for us. Your character knows how to do it too. But you've got to scratch away the surface when creating a character because no one can get to know (or wants to know) a mask.
At the centre of your character's being is the deepest layer made up of his core values and fundamental outlook on life. People are born with this layer. As they go through life their core beliefs are challenged by events they encounter and this forms the second layer--the coping layer. It forms from the character's desire to reconcile those events with his central beliefs. On top of that layer is his casual "everyday" behaviour, which consists of his methods of coping with day-to-day problems. And last is what he wants people to see him as--the mask he wears to the general public that protects both his identity and his privacy.
My mistake was creating characters with only one dimension--for instance, a person who was always cheerful or always gloomy. In reality, I myself have a fundamentally positive outlook on life, while stacked on top of it are alternating layers of cynicism and optimism (which makes me very complex--so much so that I generally can't make sense of myself). Explore your characters on a deeper level and find the ups and downs in their personalities and outlooks.
The point of layers is protection. We don't want people to find out what we're really like, especially if we've been hurt. What we call shallow people are really just people who haven't been through all the pain needed to build up layers. Their core values are there, but since they've never had them challenged they don't think about them much and their superficial personalities are all they know and can express. If your character is a shallow person, put him through painful events that will make him dig deep and find that central layer.
Did you ever wonder why tragic backstories are so popular in books and movies? It's because pain is necessary for creating realistic characters. The only difference between fiction and real life in this area is that unlike fictional characters, real people don't usually want to talk about their tragic pasts. For one thing, real tragedies aren't as cool as the ones in stories and for another thing they're usually our own fault. That makes them painful and embarrassing.
Your character will probably hide the fact that he has been hurt--maybe beneath a layer of pretended cheerfulness or maybe a layer of coldness and insensitivity, insulating him from being hurt again. How your character reacts depends on how he was hurt, but even more on who he is fundamentally, bringing us to the next point:
While the characters can't control what happens to them, they can control their own responses to what happens. Coping mechanisms abound in the real world--some people respond to pain by hiding the fact they were hurt, others by lashing out, and still others by running away.
Coping includes what I like to call "filling holes". One common mistake of writers (including myself) is to stick a character smack in the middle of a tragic backstory and then leave him there, wallowing in despair. The trouble is, in real life people don't stay in their backstories--they move on. And in order to move on they have to fill the holes left by pain and loss. People resort to all kinds of things to fill the holes in their lives, including work, ambition, friends, change of scenery (also known as running away), alcohol, crime, alternate realities, chocolate... the list goes on indefinitely.
The point is, don't make your character constantly brooding over his tragic past or whining to other people about how his family was murdered and he was tortured and life is horrible and blah blah blah. Unless he's trying to enlist support or is consumed with an obsessive desire for revenge, it's a sign that he's stuck in his backstory unable to move on with his life. In reality, life pushes people on and they have to come to terms with all that baggage in some way.
Granted, some of the coping mechanisms listed above are unhealthy and all of them are inadequate to really fill the emptiness in someone's life. Only reconciliation with the God of the universe can bring peace and only the truth can set you free. But that doesn't mean your character won't try to fix his problems using any one of these mechanisms--it just means by the end of the story he'll need to have realised that it doesn't work.
Complex characters don't stay the same throughout the story. Not only do their past choices influence the layers of their characters, their present choices do too, meaning that they will be different at the end of the story than they were at the beginning. The beauty of a complex character is that the change won't be merely on the surface--it will be a deep, inner change that affects the character's whole view of life and the world around him.
Even if a character chooses to continue believing a lie, or embracing a destructive coping mechanism, or in general going down the path to the Dark Side, his confrontation with the truth will still change him, whether he wants to be changed or not. His coping layer, possibly even his fundamental understanding of the world, will be challenged, forcing him to come to grips with hard realities and change his views of them accordingly.
Whatever choice your character makes, your readers too will have been confronted by these truths and their own views will have been challenged, allowing them to make the choice for themselves. As a writer, you can't change your readers, but you can present powerful truths that will change them.