Whenever we want to balance an equation, we have to make sure that the atoms of each element balance out or are equal on both sides. If there are two oxygen molecules, we actually have 4 atoms of oxygen because the oxygen molecule is diatomic (has two atoms). The same is the case with hydrogen and nitrogen.
The formula for ammonia is NH3 so we have to take nitrogen and hydrogen in a ratio in which this formula is satisfied while the number of atoms of each element remain the same on both sides.
The balanced equation for the reaction between nitrogen and hydrogen is:
N2 + 3H2 ---> 2NH3
We can see here that the total number of atoms of nitrogen is 2 on both sides and that of hydrogen is 6 on either side.
The formula for ammonia is NH3 so we have to take nitrogen and hydrogen in a ratio in which this formula is satisfied while the number of atoms of each element remain the same on both sides.
The balanced equation for the reaction between nitrogen and hydrogen is:
N2 + 3H2 ---> 2NH3
We can see here that the total number of atoms of nitrogen is 2 on both sides and that of hydrogen is 6 on either side.