Answer:
The volume of hydrogen gas produced will be approximately 50.7 liters under STP.
Explanation:
Relative atomic mass data from a modern periodic table:
Magnesium is a reactive metal. It reacts with hydrochloric acid to produce 
- Hydrogen gas  , and , and
- Magnesium chloride, which is a salt.
The chemical equation will be something like
![\rm ?\;Mg\;(s) + ?\;HCl \;(aq)\to ?\;H_2 \;(g)+ [\text{Formula of the Salt}]](https://tex.z-dn.net/?f=%5Crm%20%3F%5C%3BMg%5C%3B%28s%29%20%2B%20%3F%5C%3BHCl%20%5C%3B%28aq%29%5Cto%20%3F%5C%3BH_2%20%5C%3B%28g%29%2B%20%5B%5Ctext%7BFormula%20of%20the%20Salt%7D%5D) ,
,
where the coefficients and the formula of the salt are to be found.
To determine the number of moles of  that will be produced, first find the formula of the salt, magnesium chloride.
 that will be produced, first find the formula of the salt, magnesium chloride.
Magnesium is a group 2 metal. The oxidation state of magnesium in compounds tends to be +2. 
On the other hand, the charge on each chloride ion is -1. Each magnesium ion needs to pair up with two chloride ions for the charge to balance in the salt, magnesium chloride. The formula for the salt will be  .
.
 .
.
Balance the equation.  contains the largest number of atoms among all species in this reaction. Start by setting its coefficient to 1.
 contains the largest number of atoms among all species in this reaction. Start by setting its coefficient to 1. 
 .
.
The number of  and
 and  atoms shall be the same on both sides. Therefore
 atoms shall be the same on both sides. Therefore
 .
.
The number of  atoms shall also conserve. Hence the equation:
 atoms shall also conserve. Hence the equation:
 .
.
How many moles of HCl are available?
 .
.
 .
.
How many moles of Hydrogen gas will be produced?
Refer to the balanced chemical equation, the coefficient in front of  is 2 while the coefficient in front of
 is 2 while the coefficient in front of  is 1. In other words, it will take two moles of
 is 1. In other words, it will take two moles of  to produce one mole of
 to produce one mole of  .
.  of
 of  will produce only one half as much
 will produce only one half as much  .
.
Alternatively, consider the ratio between the coefficient in front of  and
 and  is:
 is:
 .
.
 .
.
What will be the volume of that many hydrogen gas?
One mole of an ideal gas occupies a volume of 22.4 liters under STP (where the pressure is 1 atm.) On certain textbook where STP is defined as  , that volume will be 22.7 liters.
, that volume will be 22.7 liters. 
 , or
, or
 .
.
The value "165.0 grams" from the question comes with four significant figures. Keep more significant figures than that in calculations. Round the final result to four significant figures.