This is a limiting reagent problem. And we'll calculate the answer based upon the stoichiometry (mol to mol ratios given by the coefficients in the balanced rxn).
Based on the 1:2 ratio, 1 mol of N2 could produce 2 mol NH3 if it's the limiting reagent.
Based on the 3:2 ratio, 1 mol of H2 could produce 2/3 mole of NH3 if it's the limiting reagent. 1 mol H2*(2mol NH3/3mol H2)=2/3 mol NH3
Whichever reactant leads to less product is the limiting reagent and leads to the theoretical yield which is the maximum amount we could get and so we can only get a maximum of 2/3 mol NH3 with H2 being the limiting reagent.