Some people believe that Lelouch had the code at the end of R2 and was immortal, but the show creators have always officially stated that Lelouch was truly dead. (I will make a summary of some of the official statements below)
Sometimes people try to invoke "Death of the Author" but even that doesn't work. "Death of the Author" still requires that the interpretation matches with what the work itself presents, that there is an internal consistency, and this is not true for code theory.
We see that Lelouch uses his geass long after his final confrontation with Charles, this is not possible if he had had the code because the anime made it very clear that you lose your geass when you get the code. ALL 4 examples of people with the code have had this happen, they all lost the geass, no exceptions. Furthermore Charles establishes that rule explicitly by saying "I've gained a new power in place of geass.
The idea that the code needs to be activated first is debunked by the anime itself, as it shows us that Charles was immune to geass. There were no red rings around his eyes, and there was no nerves realigning scene. This means Charles was immune to geass, which means his code was already "active", which means there is no such thing as an inactive code and thus codes do not need to be activated. It was later explicitly confirmed in a live commentary that Charles was indeed already immune and just toying with his son (see below).
The idea that Lelouch was a special case which allowed him to keep his geass, and thus was an exception to the normal rule is also not supported by the anime. At no point does the anime even suggest that it could be possible for someone under certain circumstances to have both a geass and a code. Nobody talks about it, thinks about it, wonders about it, etc. And there are zero precedents, all the precedents the anime shows us deny the possibility.
Without a basis in the anime, this idea is pure fanfic and entirely detached from canon lore.
Since the anime itself debunks the ideas of code theory, it is not possible to invoke "Death of the Author" as the fan interpretation doesn't fit in the anime's lore at all.
As for official statements, the provided evidence for Lelouch being truly dead is massively overwhelming. There is a compilation database on reddit which has gathered those official statements. I will highlight a couple of them. For a full overview I urge people to follow the above link.
In these interviews they explain that the death of Lelouch was a matter of principle for them (their aesthetics, their psychology, etc.), it was a matter of redemption and salvation in the eyes of Lelouch and Lelouch found peace dying for the gentler world his sister wanted.
Okouchi: "(...) That end is to Lelouch and to Suzaku both the punishment and the salvation at the same time. It's also connected to the words Lelouch said at the beginning: "Utte ii no wa utareru kakugo no aru yatsu dake da." The person who gave the punishment was punished themselves and if you want to get the salvation, give the salvation first. Of course it's also the same with Lelouch's decision to accepts the geass (wish), because he geassed many people, as he himself has said in the show. [He refers to the last episode when Lelouch says what the people of the world wish for]"
Animage: "So this was the end, but was Lelouch happy?"
Okouchi: "I think that the show had a happy ending, not a bad ending. Lelouch and C.C. talks about it in season 1 episode 7 - just living a life is meaningless. Lelouch saved his beloved sister and managed to create a kind world in his own way. His life wasn't meaningless. That's why in the end he is smiling."
Animage: "So you accept the end of the show?"
Fukuyama: "I think that before he reached that final scene, Lelouch had many possibilities to choose from. But he understood very well what he had done and had to pay the price for that. Suzaku choose to live as Zero and was awarded the opportunity to pay for his sins by this choice. And Lelouch got his salvation by choosing not the happiness of living on but to sacrifice his own life to create the situation for the world to move forward. If you think about his character, I don't think he would still be himself, if he chose other end."
The interviews from Continue (Vol.42).
In this interview they confirm that the decision to kill Lelouch was a unanimous one, the entire show staff agreed:
Continue: Was there a dispute among the staff members regarding the ending?
Okouchi: No. It was decided fairly naturally. During the "Code Geass" script meetings, there are many cases in which there were a number of disputes, but there were barely any when it came to the scripts for (the previous series's) episode 25 and the final episode. I think everyone felt the same when it came to the end of the character that is Lelouch.
They confirm that Lelouch's death was one of the first things they decided for the show and that his death was a matter of principle to them ("their sense of aesthetics"). This statement was confirmed yet again 10 years later in the tweets (see below).
Continue: Why were you so bold as to choose this ending when the viewers might see it as a Bad End?
Okouchi: Bold... yes, we were so bold as to chose this ending. Perhaps the show that is "Code Geass" ending up this way was decided the moment Director Taniguchi and I teamed up. I suppose you can call it our sense of aesthetics, or perhaps a part of our psychological makeup.
The following statements explain how they foreshadowed Lelouch's death from the very first episode with his famous line "The only ones allowed to kill are those who are willing to be killed" (exact phrazing will depend on the subs you used, of course):
Continue: Still, isn't it possible that defeating the wise ruler Schneizel, the person who was supposed to have brought order to the world, might lead to some [viewers] interpreting it as a Bad End?
Okouchi: That's true. There are probably a lot of people who think of it as a Bad End, a tragedy, considering the protagonist's, Lelouch's end as well. However, Lelouch says in the first episode: "Only those prepared to be shot are allowed to pull the trigger themselves." If you were to think of that as his pride, then I think his getting shot (killed) in the end was a logical end. Of course, I understand that not all of the viewers will accept this ending. There were people who wanted a happier ending, after all.
It is important to note that part of this last statement was often misinterpreted by code theorists as him saying that people could see it as open ended. It is clear from his words that this is NOT what he is saying. He said that he understands that some people will see Lelouch's death as a bad ending and that some people wanted a happy ending. Basically, what he is saying is that people are free to interpret Lelouch's death as happy or sad, but Lelouch's death itself was never open for interpretation, it was set in stone as the rest of the article clearly demonstrates. The ending was never meant to be ambiguous.
It is also important to note the Lelouch's death can only be interpreted as a true, final death and not something temporary until the code revives him, especially the foreshadowing of his death doesn't make sense if we see it as temporary death or faked death, but the later tweets will make this even clearer, so I will go in further depth there. (see tweets below)
As part of the 10 year Code Geass anniversary, the creators of the show started a series of tweets titled "Geass Memories" in which they reminiscence about the days when they made the show, shedding light on the production process, the way certain decisions were made, etc. Of particular relevance here are the Geass Memories 77-83:
"Before I started writing the story of a person called Lelouch, I confirmed with Taniguchi-director something. That thing was that the end of Lelouch will be death."
"At least he is aware of his sins and pays for them with his death."
"This man called Lelouch will pay for his sins by his death. The story follows him till he finally make this decision."
"Probably this Lelouch we see in the first episode of the series wouldn't choose death. He would try something to avoid it. He couldn't die, for Nunnally as well. But we see him changed in the last episode."
It is important to note that "death" here can only be interpreted as a "true, final death" and not some temporary death until the code revives him, just as was the case earlier with the explained foreshadowing. This is easily made obvious by replacing the word "death" by "death for 2 minutes" or "faked death". "Lelouch pays for his sins by being dead for 2 minutes". "Only those who are willing to fake their deaths are allowed to kill". "Lelouch being dead for 2 minutes was part of our aesthetics".
It is immediately obvious that their words simply make no sense if we assume Lelouch had the code and was immortal. The old argument "they said he's dead but not that he stayed dead" with which code theorists try to dismiss the Word of God simply does not hold water at all. (Also, who ever says something as unnatural as "he died and after that he stayed dead"?)
The Official Guide Book
The official guide book explicitly states several times that Lelouch is dead. To avoid too much repetition I will only copy the explanation of the Zero Requiem:
"For those two who bear the heavy sin known as killing their fathers, they share the belief that they can forgive each other by imposing the greatest punishments on themselves. Death for Lelouch who wishes for a tomorrow with his sister, life for Suzaku who wishes to atone for his sins through death."
This explains that Zero Requiem was not only about creating a better world, but also simultaneously redemption for both Lelouch and Suzaku for their sins (as explained above in the tweets). Lelouch eternally boinking C.C. is NOT redemption, as much as some fans might want that. It is undeniably clear here that Lelouch is truly dead.
The New Epilogue (2009)
Unlike the fake fan made epilogue which is going around on the internet (and which I will not give more attention by linking it!) where there's a fan edit which zooms in on the face of the driver and reveals it to be Lelouch, there is actually a real, new epilogue which can be found on the official release of the Zero Requiem blu-ray.
While the fake ending was nowhere to be found except on shady youtube channels from people who were pushing their code theory narrative (If it were real how did THEY get it? And why ONLY they?), the real new epilogue can be found all over the web where you watch anime (look for Zero Requiem movie).
Unlike the fake one where the image quality massively dropped during the edited zoom, the tv logo suddenly disappears, and there is no music during the edit, the real new epilogue has brand new, high quality art, music and narration by C.C.'s voice actress.
In this new epilogue, the often misunderstood hay cart scene is dropped and replaced by a new scene where C.C. talks to the audience and explicitly explains that Lelouch is dead, that she mourns his death, but that she finds comfort in the thought that he died achieving his goals.
"A young man dies. He had the power to change the world, to create a new order. The world feared him, hated him. But, I know he died with a smile on his face. Only those who have realised their dream will truly understand that feeling of utter contentment. So, this is not a tragedy. And whenever I feel sad or cry at night, I sing a song. A song of man's making. Zero Requiem!"
You can watch the new epilogue here.
Nunnally Did NOT See Memories
As if all the official statements about his death aren't enough, the creators even explictly denied some of the core points of code theory, such as Nunnally seeing memories/code visions.
In Mook Animedia (28 January 2009, p.89-90) there was an interview (see 2 pictures below) which explicitly denied that Nunnally was seeing visions or that those images had anything to do with codes or geasses.
Q: "How did Nunnally managed to realize Lelouch true intention, when she touched his hand at the end?"
Staff member K: "The way Nunnally can tell that someone is lying, just like she was able to tell that Lohmeyer was lying to her, is that she can feel the hand of the person she is talking to is sweating or lightly trembling. It's nothing like Geass or some special ability like that."
Staff member Y: "Yes. So, she simply came to conclusion [Lelouch was lying] by herself, because of this ability."
Staff member K: "She is Marianne's daughter and Lelouch's little sister. Two months have passed since that defeat of Schneizel and for this two months she's been wondering constantly about what had happened, like "why it happened?" and so on. So when she touched Lelouch's hand at the end she felt that he is calm, she put the two and two together and realized the truth. Of course, we know that in anime, it's hard to explain things like that, but yeah, please accept it like this kind of romantic idea we had."
Codes Do NOT Need To Be Activated
The release of the Code Geass movies was accompanied by various Code Geass related events, some of these were, obviously, live interviews and live commentary. The following are excerpts from commentaries given by Okouchi, Taniguchi-producer and two other producers when they talked about the scene where Lelouch attempted to geass his father. This was documented by people who were present at these events. To protect the privacy of these people, I have removed all information which would allow them to be identified.
This tweet reads パパんにギアス掛けるシーンも、「これギアス掛かってないのに死んだふりするんだよ」「息子を驚かせようと」「ルルーシュくんかわいそう」「これ一番ショックなタイミング計ってるよね」「絶対笑いこらえてるよ」って色々言われてて笑った。
Translation: About that scene Lelouch geass his dad I laughed because they said like "He isn't geassed, just pretends he dies!" " He tries to surprise his son!" "Poor Lelouch" "He tries to choose the most shocking timing, doesn't he" "I'm sure he tries hard not to laugh"
This blog post talks about various Code Geass things, the relevant part is highlighted in red and reads コウジロウさん「この人、ギアスかかってない じゃないですか。よく我慢してますよね。こことか 絶対笑い堪えてますよ」
Translation: "He isn't under an influence form Geass, is he? He's good with pretending, sure. I'm sure he tries his hardest not to laugh right now."
The creators are saying Charles is immune to geass already, that means Charles already had an "active" code, which means that codes are never not active and thus don't need activating.
There's is a mountain of official statements which all repeat the same thing Lelouch is truly dead.
When you put all these things next to each other, you see this conclusion is inescapable, consistent and waterproof.
Some people will argue that the fact that a sequel is coming with Lelouch as the officially confirmed protagonist is proof that he's alive/immortal, but it is, in fact, the exact opposite. The official name of this sequel is "Lelouch of the Resurrection". when you combine all the official statement about him being truly dead, him returning for the sequel and the sequel's name, it is obvious that Lelouch will start as dead in the sequel and will somehow be resurrected, he'll return from the grave somehow.
Some people will argue that the sequel is an AU (alternate universe) which somehow must mean Lelouch is immortal. It is indeed true that the sequel will follow the movies and not the original series, and these movies have 1 BIG difference with the original series which makes it an AU. However, this change does not directly involve Lelouch, Zero Requiem still happens, Lelouch still dies, so as far as the movies show, all of the statements about R2 also apply to the sequel.
This summary of official statements was based on a compilation post from reddit. The compilation post consists of 2 parts, part 1 gathers all the official statements, part 2 shows how the anime itself contradicts code theory because code theory violates the rules established by the anime's canon.
That post is very long (even linger than this answer), but it is thorough and complete, and an absolute MUST READ for all Code Geass fans.
When faced with such a massive amount of official statements which all repeat that Lelouch is truly dead, combined with the fact that the anime itself contradicts core points of code theory, why do so many people still cling to the debunked theory?
Wouldn't it be more respectful to Lelouch, to the anime and to the creators to accept the work that was made the way it was made? Especially because the creators made a point of it that Lelouch's death was a matter of principle for them.