In flasks 1 and 2, a small amount of Mg is used and therefore the metal is the limiting reagent. In flask 3, the reagents are added in a stoichiometric ratio. In flask 4, excess Mg is added and HCl ...
It is the limiting reactant. Now use the moles of the limiting reactant to calculate the mass of the product. Remember to use the molar ratio between the limiting reactant and the product.