Since nitrogen has 5 electrons in its outermost shell so, to achieve the 8-electron structure of an inert gas, it needs 3 more electrons and hence combines with another nitrogen atom to form a molecule of nitrogen gas.

This type of bonding is called covalent bonding.