Step 1: determine the reaction
The chemical equation is already given.
$"Mg" + 2 "HCl" -> "MgCl"_2 + "H"_2$
Step 2: determine which reactant is limiting
0.100 mol of Mg reacts with 0.500 mol of HCl, which of them will run out first?
From the reaction, the ratio of $"Mg"$ to $"HCl"$ used is $1:2$. This means that if the reaction goes to completion, the $0.100 "mol"$ of $"Mg"$ will react with $0.100 "mol" xx 2 = 0.200 "mol"$ of $"HCl"$. This leaves $0.500 "mol" - 0.200 "mol" = 0.300 "mol"$ of $"HCl"$.
Step 3: determine how much $"H"_2$ is produced.
$0.100 "mol"$ of $"Mg"$ and $0.200 "mol"$ of $"HCl"$ will produce $0.100 "mol"$ of $"H"_2$.
Step 4: determine the volume at STP
Each mole of ideal gas occupies $22.4 "L"$ at STP. Therefore, $0.100 "mol"$ of $"H"_2$ will occupy $2.24 "L"$ of space.