Percent composition is the percent by mass of each element present in a compound. In that compound, there are two moles of H atoms and 2 x 1.008 = 2.016 grams. That's how many grams of hydrogen are present in one mole of water. There is also one mole of oxygen atoms weighing 16.00 grams in the mole of water.