Im assuming your looking for the method?
First, using the mass of Mg solid used in the reaction, you calculate the moles of Mg used, using the equation: moles = mass/ relative molecular mass(RMM) (RMM Mg = 24.305 g/mol).
You should get 2.06EXP-3 (0.00206) moles.
Now from the chemical equation, you know that the mole ratio between Mg and H2 is 1:1.
Therefore the number of moles of Mg used is equal to the number of moles of H2 produced.
Using that value for the number of moles of H2, use the equation PV = nRT.
P = pressure = 100.5 kPa (or 101325 Pa at STP)
V = volume = ? m^3
n = number of moles of H2 gas
R = universal gas constant = 8.314 J/K/mol
T = absolute temperature = 295.15 K (or 273.15 K at STP)
You should get 0.000046 m^3 of H2 gas produced, which when converted is almost the same answer as you have.
(N.B. There is an assumption here however, that the hydrogen gas is behaving like an ideal gas).