The balanced chemical equation for the reaction N2(g) + H2(g) → 2NH3(g) tells us that 1 mole of N2 reacts with 3 moles of H2 to produce 2 moles of NH3.
Therefore, the number of moles of NH3 produced would depend on the number of moles of N2 and H2 that react with each other.
For example, if we have 2 moles of N2 and 6 moles of H2, then all of the N2 will react with 2 of the 6 moles of H2, producing 4 moles of NH3. The remaining 4 moles of H2 will be left over.
In general, the number of moles of NH3 produced can be calculated using stoichiometry and the number of moles of N2 and H2 that react with each other.