Balance reaction for electrolysis of water is:

H2O  ------------------------------>  H2  +  1/2O2
the electrolysis of one mole water produce one mole of H2 and half mole O2. at the same condition (temperature, pressure) from ideal gas equation
PV = nRT                        where R is gas constant
apply for Hydrogen:
   PV1 = RT        ----------------------(1)
apply for Oxygen:
PV2 = RT/2      --------------------------(2)
V1/V2 = 2
hence in the electrolysis of water volume of gas over one electrode is double the volume of gas collected over other electrode.

Due to the decomposition reeaction H2O gets converted in to H2 & O2.
since water contains 2 atoms of hydrogen & one atom of oxygen. so hydrogens volume is =2(volume of oxygen produced)
2 5 2