This is a stoichiometry problem
H2O ----> H2 + O2
Start by balancing the equation.
2H2O ----> 2H2 + O2
Then convert your 5.2 grams to moles
5.2 g H2O X 1mole H2O/18gH2O = 0.289 moles (i used rounded values for the formula mass of H2O)
Now that you know the number of moles use the molar ratio to find the number of moles of H2 and O2
0.289 Moles H2O X 2 moles of H2/2 moles of H2O this yields 0.289 moles of H2
similarly
0.289 Moles H2O X 1 moles of O2/2 moles of H2O this yields 0.145 moles of O2
Now convert the moles of both H2 and O2 back to grams by using their formula masses
0.289 moles of H2 X 2 gH2/mole H2 =0.578 g of H2
similarly
0.289 moles of O2 X 32 g O2 /mole O2 = 9.248 g of O2