A mole consists of 6.022 x 10²³ units, these units could be atoms making up an element or molecules making up a compound.
Nitrogen gas is a compound - N₂ gas and its made of N₂ gas molecules.
1 mol of N₂ is made of 6.022 x 10²³ nitrogen molecules.
The sample contains 6.0 x 10²⁴ atoms of N, however nitrogen gas is made of N₂ molecules, 2 N atoms make up one nitrogen gas molecule. Therefore the number of nitrogen molecules are half the number of N atoms in the sample
Number of nitrogen molecules - N₂ - 6.0 x 10²⁴ / 2 = 3.0 x 10²⁴ N₂ molecules
6.022 x 10²³ molecules of N₂ make up 1 mol
then 3.0 x 10²⁴ molecules of N₂ make up -( 1 / 6.022 x 10²³ ) x 3.0 x 10²⁴
number of N₂ moles - 5.0 mol
there are 5.0 moles of N₂ in the sample