
Qui-Gon Jinn stumbled on the way to retain his identity after death. He did this through his use of compassion. Being able to let go of all sense of personal self, he was able to retain his consciousness after death (when he was killed by Darth Maul).
While on the "other side" so to speak, he met up with a "Shaman of the Whills" who taught him a second technique that allows one to become one with the Force at will, something Qui-Gon hadn't learned before his death. He teaches both of these techniques to Yoda and Obi-Wan, who both do not die in the traditional sense. Obi-Wan was gone before Vader's blade touched him, and while Yoda was on his death bed, he chose to give himself to the Force before he actually died. That's why both of them disappear and why Qui-Gon does not.
According to Lucas Anakin -does- disappear, but it is not shown in the film. He says he did that to build suspense for wether or not he would be able to retain his identity, so that when he does appear a ghost it's more of an emotional release.
His final act of sacraficing himself to finally do away with the Sith for the sake of the rest of the galaxy, he was able to retain his identity. While Anakin never learned how to give himself to the Force, Lucas says that Yoda and Obi-Wan helped do that for him at the last moment.
Here is a cut scene from ROTS that gets into all of this a bit.
QUI -GON: (V.O.) Patience. You will have time. I did not. When I became one with the Force I made a great discovery. With my training, you will be able to merge with the Force at will. Your physical self will fade away, but you will still retain your consciousness. You will become more powerful than any Sith.
YODA: Eternal consciousness.
QUI-GON: (V.O.) The ability to defy oblivion can be achieved, but only for oneself. It was accomplished by a Shaman of the Whills. It is a state acquired through compassion, not greed.
YODA: . . . to become one with the Force, and influence still have . . . A power greater than all, it is.
QUI-GON: (V.O.) You will learn to let go of everything. No attachment, no thought of self. No physical self.
YODA: A great Jedi Master, you have become, Qui-Gon Jinn. Your apprentice I gratefully become.
YODA thinks about this for a minute, then BAIL ORGANA enters the room and breaks his meditation.
BAIL ORGANA: Excuse me, Master Yoda. Obi-Wan Kenobi has made contact.
I wouldn't be surprised if this scene is put back in to a future release. Perhaps the timing didn't work out for Liam to record the lines for the theatrical release. Although I have heard accounts that they tried the scene with a placeholder voiceover and decided it just wasn't needed. YODA: Eternal consciousness.
QUI-GON: (V.O.) The ability to defy oblivion can be achieved, but only for oneself. It was accomplished by a Shaman of the Whills. It is a state acquired through compassion, not greed.
YODA: . . . to become one with the Force, and influence still have . . . A power greater than all, it is.
QUI-GON: (V.O.) You will learn to let go of everything. No attachment, no thought of self. No physical self.
YODA: A great Jedi Master, you have become, Qui-Gon Jinn. Your apprentice I gratefully become.
YODA thinks about this for a minute, then BAIL ORGANA enters the room and breaks his meditation.
BAIL ORGANA: Excuse me, Master Yoda. Obi-Wan Kenobi has made contact.