The mole ratio of reactants and products is learned by comparing the coefficients of the balanced equation. The current equation is unbalanced, so adding some coefficients to help balance the reactants and products is necessary.
2H2 + O2 —— 2H2O
In this equation, you can count the number of hydrogens and oxygens on each side to verify that there are the same on each. Now, compare the coefficients:
2H2:2H2O
2:2
The mole ratio of hydrogen to water is 2:2, simplified to 1:1. Choosing which ratio is to be used is dependent on the context of the question, however both are technically correct.