We are given the number of moles of solid magnesium supplied for the reaction which is 0.02 moles while hydrochloric acid is supplied in excess thus we can say that the reaction proceeds to completion. Calculation is as follows:
0.020 mol Mg ( 1 mol H2 / 1 mol Mg ) = 0.020 mol H2 gas is produced
To convert the number of moles to volume, we use the conditions at STP of 1 mol of a substance is equal to 22.4 L. Thus,
0.020 mol H2 (22.4 L / 1 mol) (1000 mL / 1 L) = 448 mL