The equation has equal number of H and O atoms on the two sides of the equation.
However, the reactant side has atomic oxygen, O. Oxygen exists in stable form as dioxygen, O2.
Hydrogen, H2 reacts with O2 and not O to form H2O and hence we cannot write O on the reactant side.
The reactants are H2 and O2 and product is H2O.
Also, to balance a chemical equation, the subscripts on a molecule cannot be changed.
The balanced equation is 2H2 + O2 = 2H2O