Eye of the Moon Plan

The is Madara Uchiha's ultimate plan to create an idealistic world. The plan was later adopted by Obito Uchiha. With the Allied Shinobi Forces considering this as nothing more than robbing humanity of their free will, they intend to fight against its completion. This led to the declaration of the Fourth Shinobi World War.

The Plan
Madara created the plan by studying his distant ancestor, the Sage of the Six Paths. He resolved to gather the nine tailed beasts and merge them with the Demonic Statue of the Outer Path in order to revive the Shinju. Then, he would become its jinchūriki and use the flower on its true form to reflect his Mangekyō Sharingan on to the moon, which had previously served as a container for the Ten-Tails' body, and shroud the world in an. This scheme would result in Madara's ability to manipulate every living creature, ceasing all conflict by purging free will itself from the world.

Obito's Part
Due to his poor health and old age, Madara could no longer work on the plan at some point, and left its completion and his will to Obito Uchiha. Obito would then join and take control of the Akatsuki after Yahiko's death, though most of its members were unaware of the organisation's true objectives. Posing as Madara, Obito ensured that Nagato, the figurehead of Akatsuki, would revive Madara with the Outer Path: Samsara of Heavenly Life Technique when the plan finally came to fruition at the cost of the latter's life. Nagato believed they were collecting the tailed beasts to create a powerful weapon that would utilise mutual destruction to ensure peace. Obito's personal ambition for the Eye of the Moon Plan is to remove the agency of all living creatures and create a reality without war or suffering. He had also approached Kisame Hoshigaki, requesting his participation in the cabal with the offer of liberating him from the "world of lies"; Kisame, having lived a life tainted with duplicity and betrayal, gladly accepted to abide in the "world of truth" he desired, and along with Obito and Zetsu, became one of the only Akatsuki members to know the truth of the organisation's agenda.

At some point however, Obito had come to disregard Madara's role in this plan, openly declaring that the two of them were never allies. He instead desired to become the Ten-Tails' jinchūriki himself to create his perfect world, and usurped Madara's position as the caster of the Infinite Tsukuyomi. He had planned to use Nagato's Samsara of Heavenly Life Technique on himself should anything happen to him and when the opportunity presented itself, circumvented Madara and successfully sealed the Ten-Tails within himself.

Madara's Insurance
Despite his need for Obito to carry out the majority of the legwork for his plan, Madara set up a number of fall backs to ensure the plan would proceed exactly as he desired. He created Black Zetsu for the sole purpose of forcing Obito to comply with Madara's revival. Should Obito decide to not bring the deceased Uchiha back, Black Zetsu would possess and compel whomever possessed the Rinnegan to use the Samsara of Heavenly Life Technique to bring Madara back. As the original creator of Zetsu, Madara could communicate with all of his clones and give them directions, furthering his goals without requiring effort on his part. Madara was also very adaptable with the endgame of his plan, as in the event he was revived in a form that could not become the Ten-Tails' jinchūriki, he could manipulate the Zetsu cells in Obito's body to force him to act as he wished anyway to get his plan back on track.

Progress of the Plan
Though Obito obtained seven of the nine tailed beasts, only the final two tailed beasts: the Eight and Nine-Tails, remained out of his grasp. After Nagato's death ruined any chance of Madara's resurrection and Sasuke Uchiha's failed attempt to capture Killer B provided him with a fragment of the Eight-Tails' power. Obito decides to take Madara's place in the Eye of the Moon Plan. Discarding all caution and revealing himself, Obito arranged to place Sasuke and his team at the Kage Summit in hopes the ninja leaders would be weakened enough to be easily taken hostage to negotiate their freedom in exchange for the last two living jinchūriki, Killer B and Naruto Uzumaki. This, however, ended in failure, due to Danzō Shimura escaping during the chaos while combined forces of the Kage, their bodyguards, and Mifune overwhelmed Sasuke. Sending Sasuke into the other dimension with Karin, Obito introduces himself as Madara while revealing this plan to the four Kage. However, they refuse to hand over Killer B and Naruto while creating the federation of the Allied Shinobi Forces to prevent Obito from achieving his Eye of the Moon Plan.

At the end of the first day of the Fourth Shinobi World War, Obito stole the Kohaku no Jōhei and Benihisago that each contained one of the Gold and Silver Brothers, and having already fed the Eight-Tails' tentacle to the Demonic Statue, intended to put the plan into motion by the end of the following day. Madara's resurrection through Kabuto Yakushi's Impure World Reincarnation disrupted Obito's deception, and when engaging Naruto his mask was shattered, revealing his true identity. Obito fed the Kohaku no Jōhei and Benihisago to the Demonic Statue in order to revive an incomplete Ten-Tails, claiming that the monster would still have enough power to be sufficient in completing his plan. Once joined by Madara after he defeated the Kage, Obito is berated for deviating from the original machination due to the Ten-Tails' revival being incomplete and his own revival through a different method. Regardless, entrusting Obito to make sure no one interferes as he battles Naruto and Killer B, Madara decides to capture the Eight and Nine-Tails personally to complete the plan while there is still time. Though Naruto and Killer B made an attempt to destroy the Demonic Statue with a giant Tailed Beast Ball, they were unable to stop the Ten-Tails' revival.

Though he attempts to control the Ten-Tails by having himself and Obito use Hashirama's DNA, Madara notes that the monster is beginning to resist control. Because he was revived by Impure World Reincarnation, Madara is only a reanimated corpse and cannot become the Ten-Tails' jinchūriki, which would require him to be brought back as a living body with Samsara of Heavenly Life Technique that only Obito, having obtained his master's Rinnegan, could now execute. However, using that fact as leverage since using the technique would kill him, Obito persuades Madara into letting him use the Ten-Tails to give despair to Naruto and the entire Allied Shinobi Forces. However, it had the opposite effect as Naruto and his comrades manage to sever the means that the Uchiha used to control the Ten-Tails with Obito temporary sent to other dimension while uncontrolled colossus begins to rampage on the battlefield. It was only once Obito returned that Madara callously activated the chakra receivers inside Obito's body to force him into using the Samsara of Heavenly Life Technique. However, Obito never intended for that to happen and overcomes Madara's control to seal the Ten-Tails inside his own body, thus becoming its jinchūriki. Not long after restraining the beast and taking full control of its power, Obito transforms Shinju into its original form to complete the Infinite Tsukuyomi. In retaliation, Madara intends to stop Obito before the completion and take his place by using Hashirama Senju's sage powers.

The plan is interrupted when Naruto, B, Sasuke Uchiha and the rest of the Allied Shinobi Force pulled out all nine tailed beasts' chakra from Obito's body, preventing the Shinju from blooming. After that, inside his subconscious, Obito is assaulted by fleeting visions of an alternate future based on if he never took up the Eye of the Moon Plan, and started to conclude that he is subconsciously regretting his actions affiliated with the plan.

Following Obito's defeat, with the aid of Black Zetsu controlling the former to perform the Samsara of Heavenly Life Technique, Madara finally revives himself and steals Hashirama's Sage Mode to acquire his healing techniques and fight against the nine tailed beasts. Upon receiving his right eye, Madara knocks down the tailed beasts, restrains and seals them into the Demonic Statue of the Outer Path to initiate the plan once again.

Trivia

 * Obito has blamed Naruto for the plan's slow progress, due to his constant interference causing him to deviate from the early parts of plan as Madara envisioned. He ultimately intended to become the Ten-Tails' jinchūriki instead of Madara.
 * Obito noted that he had thought of synchronising Sasuke Uchiha with the statue. However, Obito had likely dropped this idea due to how Madara was reincarnated already by Kabuto.