Answer
The 28g from the first equation of N2 is the mass of N2 per 1 mole.
If you look at the periodic table, you will see that Nitrogen has a molar mass of 14 u, since it is 2 nitrogen atoms, you say 14 x 2 = 28 g/mol.
Your teacher wanted to convert the mass of N2 to moles, that is why the mass is divided by 28 g (which is per 1 mole).