Here, we're going to say that atoms form multiple bonds when valence electrons are not enough to satisfy the octet. So we're talking about the octet rule, where one element ideally wants to have 8 electrons around it, so it can help to fulfill the same type of electron arrangement as a noble gas.
So here if we take a look, we have nitrogen shown with a single bond between the 2 nitrogens or a triple bond between them. Looking at the differences, we can say here that each nitrogen in the first structure, we have a total of 10 valence electrons being used. Remember, a single bond has 2 electrons in it, so that'd be 2, 4, 6, 8, 10. We have 10 valence electrons. But we run into an issue. Both nitrogens have an incomplete octet.
Remember when we have a covalent bond, we're sharing the electrons within that covalent bond with each other. So the nitrogen on the left has 2, 4, 6 electrons around it. And the same thing can be said with the nitrogen on the right. It has 2, 4, 6 electrons around it. It's not fulfilling its octet rule. To deal with this, it's better to create a triple bond between the 2 nitrogens, so they still have 10 valence electrons because we have 2,4,6,8,10. And this is the better way of drawing it because each nitrogen has 2, 4, 6, 8 electrons around them.
So just remember, sometimes we'll have to create multiple bonds, double bonds, possibly triple bonds, in order to fulfill the octet rule for any given atom. Now remember, hydrogen doesn't fit here. Hydrogen does not follow the octet rule. It follows the duet rule, where it only wants to have 2 electrons around it so they can resemble helium.