Back long before the start of Naruto there was a war between Iwagakure (The Land of Earth/Stone) Kirigakure (The Land of Mist/Water) Kumogakure (The Land of Lightning) And Konogakure (The land of fire) just ignore everyone besides Konoha and Iwagakure though, they aren't important to the story here.
For the moment anyway...
Anyway on a mission to destroy a bridge that crosses a gorge between the land of earth and fire, this genin known as "obito" Uchiha is lost and presumed dead, Through stuff that i won't mention because it would add another fourteen paragraphs to the story, and also involves heavy spoilers, he survives being crushed and buried alive.
He then assumes the identity of his rescuer "Madara Uchiha" One of the founders of Konoha and a figure of myth and legend in the world they live in, although he was nearing a hundred years of age at the time, and hadn't been seen for decades by this point (unrelated story) but anyway he assumes Madara's identity while he works to complete his master's ultimate plan, which also will not be covered here due to me not wanting to sit down and explain the entire thing.
But yeah Obito assumed a well known figures name, to hide his own, hence the whole mask deal and alike.