The octet rule is only applicable to the main group elements. The molecules of the halogens, oxygen, nitrogen, and carbon are known to obey the octet rule. In general, the elements that obey this rule include the s-block elements and the p-block elements (except hydrogen, helium, and lithium).