The theoretical yield is the yield after a certain reaction occurs. So if you are given 17.1 g of H2 and an excess of N2, you should know the balanced equation.
N2 + 3H2 → 2NH3
Molar mass of H2 = 2.02 g/mol
Molar mass of NH3 = 17 g/mol
(17.1 g of H2)(1 mol H2/2.02g H2)(2 mol NH3/3mol H2)(17g NH3/1mol NH3) = 95.94g NH3