$$3H_2(g) + N_2(g) \rightarrow 2NH_3(g)$$
According to the stoichiometry of the reaction, 3 moles of hydrogen gas react with 1 mole of nitrogen gas to produce 2 moles of ammonia. Therefore, if 6 mol of hydrogen gas react, the number of moles of ammonia produced can be calculated as follows:
$$6 mol H_2 \times \frac{2 mol NH_3}{3 mol H_2} = 4 mol NH_3$$
Therefore, 4 moles of ammonia are produced when 6 mol of hydrogen gas react with an excess of nitrogen gas.