So it was destined before Sam was born to be Lucifer's vessel, but Lucifer need to take some precautions. So he had Azazel create the special children, in addition to freeing Lilith. Then in Season 2's finale, hell's gate was opened and Lilith set free. The next step was to get Dean to hell, so he could break the 1st seal. Once the first seal was broken, Lilith began breaking the rest of the 66 seals so Lucifer himself could rise. Sam is the one who breaks the final seal, and watched Lucifer rise.
|“||"I will never lie to you. I'll never trick you. But you will let me in.""Why me?""Because it had to be you. It always had to be you."||”|
— Lucifer and Sam
in Free To Be You and Me
Sam continues to fight his destiny, and begins searching for the colt. When they find it, they go after Lucifer in Abadon All Hope... hoping it will kill it. Sam uses himself as bait to draw Lucifer's attention so Dean can shoot him. But it doesn't work, and Lucifer continues on with the ritual to summon Death. Lucifer comments on how tiresome it is waiting for Sam to say Yes. Sam tells Lucifer he'll never say yes, but Lucifer disagrees and believes Sam will say yes soon, in about six months. Sam swears to kill Lucifer, and Lucifer comments on how Sam should keep that anger, cause he'll need it. Lucifer also tells Sam the story of him and Michael, and comments on how its similar to Sam's own life. Sam manages to escape from Lucifer with the help of Castiel.
They briefly meet again in Hammer of the Gods, Sam quickly leaves. Then Sam gets the idea to trick Lucifer into the cage in The Devil You Know, by saying Yes, and jumping in with Lucifer inside. Bobby points out to Sam that Lucifer will poke at everything to get control, but Sam believes he can best Lucifer.So they manage to collect all the rings and stop the outbreak of the Croatoan virus. In Swan Song, Sam heads to say Yes to Lucifer. Unfortunately, Lucifer knows about Sam's plan to jump with him back into the cage. But Lucifer is confident he can overpower Sam and makes a wager. If Sam gets control he can jump into the cage, if Lucifer gets control, well he wins anyways. So Sam takes the wager and says Yes. Lucifer leaves his old vessel, and goes into Sam. Lucifer overpowers Sam and gains control over the vessel. Trying to make Sam accept it, he reveals Azazel's gang of demons that have been watching Sam since he was a child, and kills them all.
Lucifer is still trying to appease Sam by letting Dean live, until Dean gets on his final nerve and begins to beat Dean. Before Lucifer can deal the final blow, Sam takes over to save his brother and jumps into the cage.
Since Sam jumped into the cage, Lucifer had ruthlessly tormented Sam's soul. Sam's soul was in the cage with Michael and Lucifer for a year and a half in earth time, tortured and abused by both of the archangels. Being an immortal soul, Sam's essence could not be broken, but was left with severe psychological damage.
|“||"Riiight. You think this fruit bat fever dream is reality? You come back - I'm sorry - with no soul as some peppy American psycho until Saint Dean glues you back together by buying you some magical amnesia? You're real. I'm very real. Everything in between is what we call set dressing.""No!""You're still in my cell. You're my bunk mate, buddy. You're my bitch in every sense of the term."||”|
— Lucifer and Sam
in Hello, Cruel World
Back at Bobby's, Lucifer continues to mock Sam, and Sam reveals to Dean that he is seeing Lucifer. Sam is still confused whats real since Lucifer is very convincing. Every time Sam is asked if hes fine, hes sees Lucifer, but Sam lies saying hes fine. Sam later approaches Lucifer and asks why he doesn't end it. Lucifer tells Sam he has Sam right where he wants him. It will only end when Sam can't take it anymore.Then Lucifer takes on Dean's form and tricks Sam into leaving Bobby's and into a warehouse. Inside, Lucifer changes back, and Sam pulls a gun on him. Lucifer reveals to Sam the only way to end it is for Sam to kill himself. Then Dean arrive on the scene, and Lucifer continues to mock Sam, and Sam responds by shoting at Lucifer unsuccessfully. Then Dean teaches Sam how to get rid of Lucifer by using the pain from the scar. Sam seeinf Lucifer flicker, and Lucifer attempts to show no weakness by this. Realizing he can control this, Sam uses the pain to banish Lucifer from his sight. Sam sees Lucifer again though when he gets a head injury from Edgar, and Lucifer tells Sam he isn't going anywhere.
In Repo Man, Lucifer returns pestering Sam and trying to get Sam's attention. Sam tries to ignore it and uses his scar to get rid of Lucifer more than once. But when Dean disappears, Lucifer begins to point out things to Sam. Realizing Lucifer is right, Sam searches through Jeffery's room and finds demon summoning items. Lucifer even convinces Sam to get rough with Nora to get information. After they find Dean, Sam tries to banish Lucifer again, but as he welcomed Lucfier's help, as such welcomed Lucifer into his mind, his scar can no longer be used to get rid of Lucifer, causing the creature to burst out laughing when he tried it.Now no longer able to be banished, Lucifer begins to torment Sam causing Sam to be unable to sleep. Sam attempts to drink and use drugs to be able to sleep, but nothing stops Lucifer from tormenting Sam. This leads to Sam landing into a mental ward at the hospital. Lucifer does everything from lightning fire crackers, to playing with a megaphone. Sam's condition crumbles to a state where he can only see Lucifer. Thanks to Castiel's help, Sam no longer sees Lucifer.