The balanced equation is 2H2O --> 2H2 + O2.
The equation needs to have the same amount of hydrogen and oxygen on the same side. When you're breaking up H2O, you'll get hydrogen gas and oxygen gas. Both hydrogen and oxygen are diatomic, meaning they're found in compounds and not in their elemental state. Therefore, when you break up H2O to H2 and O, and you know that oxygen is diatomic, oxygen has to be O2. However, due to two oxygen atoms on the right side of the equation, the equation isn't balanced anymore. In order to balance the equation, you need to have two oxygens on the left side of as well so you hadd a 2 in front of the H2O. However, that leads to 4 hydrogen molecules on the left side. In order to balance that out, you add another 2 in front of the H2 to get it balanced.
I think you already know what I'm talking about but I wasn't sure which 2 you're confused on. Just in case, I gave a full explanation about balancing the equation. I hope I answered your question.