Well, you already know that Nitrogen is diatomic. Your question is, why do they have a triple bond. It's quite simply when you think about it, all diatomic molecules will share electrons in the perfect manner in order to fill their own octet. Nitrogen needs to fill it, and seeing that it only has 5 valence electrons, it needs a triple bond with another nitrogen in order to achieveĀ it. 5+3 = 8 (full shell)