where did anakin live before he met qui-gon
Darth Vader Anakin first appears in the prequel trilogy in Star Wars: Episode I – The Phantom Menace, which takes place 32 years before the original Star Wars, as a nine-year-old slave[63] living on the planet Tatooine with his mother Shmi. Anakin was conceived without a father and he can foresee the future. Also a gifted pilot and mechanic, Anakin has built his own protocol droid, C-3PO. Jedi Master Qui-Gon Jinn meets Anakin after making an emergency landing on Tatooine. Qui-Gon senses Anakin's strong connection to the Force and becomes convinced that the boy is the "Chosen One" of Jedi prophecy who will bring balance to the Force. After winning his freedom in a podrace, Anakin leaves for Coruscant to be trained as a Jedi, but is forced to leave Shmi behind. During the journey, Anakin forms a bond with Padmé Amidala, the young queen of Naboo. Qui-Gon asks the Jedi Council for permission to train Anakin, but they sense fear in the boy and refuse. Eventually, Anakin helps thwart the Trade Federation's invasion of Naboo by destroying their command ship. After Qui-Gon is killed in a lightsaber duel with Sith Lord Darth Maul, Obi-Wan promises to train Anakin, with the Council's reluctant approval.[62] Supreme Chancellor Palpatine (the future Emperor) later befriends Anakin and tells him that he will watch the boy's career "with great interest".
Star Wars: Episode III – Revenge of the Sith Palpatine appoints Anakin to the Jedi Council as his representative, but the Council declines to grant Anakin the rank of Jedi Master and orders him to spy on Palpatine, causing Anakin's faith in the Jedi to diminish significantly. Palpatine tantalizes Anakin with secret knowledge of the dark side of the Force, including the power to save his loved ones from dying. Meanwhile, Obi-Wan travels to the planet Utapau, where he kills Grievous, and Yoda travels to Kashyyyk to defend the planet from invasion. Tempting Anakin, Palpatine eventually reveals that he is the Sith Lord Darth Sidious, saying that only he has the knowledge to save Padmé from dying. Anakin reports Palpatine's treachery to Mace Windu, who confronts and subdues the Sith Lord, severely disfiguring him in the process. Fearing that he will lose Padmé, Anakin intervenes on Palpatine's behalf and severs Windu's hand, allowing Palpatine to throw him out of a window to his death. Anakin pledges himself to Palpatine, who dubs him Darth Vader. Palpatine issues an order for the clone troopers to kill their Jedi commanders and dispatches Vader along with a legion of clones to kill everyone in the Jedi Temple. Vader then massacres the remaining Separatist leaders hiding on the volcanic planet Mustafar, while Palpatine addresses the Galactic Senate, transforming the Republic into the Galactic Empire and declaring himself Emperor. Having survived the chaos, Obi-Wan and Yoda return to Coruscant and learn of Anakin's treachery.