One mole of any substance contains Avogadro's number of atoms.
This means that one mole of nitrogen contains 6.022 * 10^23 atoms.
To know the number of moles containing 6 * 10^24 atoms, all you have to do is cross multiplication as follows:
number of moles = (6*10^24 *1) / (6.022*10^23) = 9.963 moles which is approximately 10 moles
Since one nitrogen molecule has two nitrogen atoms, therefore, the sample has 10/2 = 5 moles of nitrogen molecules