# Why dosen't No2 form according to the octet rule?

Supposedly every atom that is in the second period of the periodic table has to obey the octet rule, this means that they have to be surrounded by 8 electrons (or so I was taught). Studying resonance in an exercise they showed how nitrogen as NO2 can form 5 bonds, which would mean that NO2 does not behave according to the rule previously mentioned. I am at a loss, any help would be great.

No atom has to obey the octet rule. It is a rule. It has no theoretical justification. It works often. But that's all that could be stated. And a lot of compounds are known that do not follow this rule like $$O_2, NO, B_2H_6$$, etc. And Nitrogen does not form 5 bonds. It cannot. $$4$$ bonds is the maximum for atoms of the second period (Li, Be, B, C, N, O, F).