The balanced chemical reaction is as shown below,
N₂ + 3H₂ --> 2NH₃
The equation shows that every 3 moles of hydrogen, H2, there would be 2 moles of ammonia, NH3, that is going to be formed. Using this concept, we solve for the unknown in this item.
Since we are restricted only of the number of hydrogen, it becomes our limiting reactant.
(6 moles H2) x (2 moles NH3/3 moles H2) = 4 moles NH3
Therefore, given enough amount of N2, the amount of NH3 that can be formed out of the 6 moles of H2 is equal to 4 moles.