\(n_{H_2}=\dfrac{2.24}{22.4}=0.1\left(mol\right)\)
\(Mg+2HCl\rightarrow MgCl_2+H_2\)
\(0.1.......0.2...........0.1..........0.1\)
\(m_{Mg}=0.1\cdot24=2.4\left(g\right)\)
\(C_{M_{HCl}}=\dfrac{0.2}{0.5}=0.4\left(M\right)\)
\(C_{M_{MgCl_2}}=\dfrac{0.1}{0.5}=0.2\left(M\right)\)