Every rule has its exception, and that goes for the Octet Rule as well. While there are many scenarios where the Octet Rule does not apply, this relatively short article will only cover one of them. The Duet Rule applies to hydrogen and helium only, but the abundance of hydrogen is so prominent that the rule deserves its own article. For hydrogen and helium, unlike most other elements, a full valence shell consists of two electrons rather than eight.
Helium atoms have two electrons and two protons. There is only one shell of electrons, the valence shell of two electrons. It is a noble gas and is ths relatively inert. If it needs to gain electrons as part of a bonding sequence, it will need to form a new valence shell further away from the nucleus than the old one. That said, any bizarre bonding patterns with helium are not sufficiently practical or simple to be taught in high school chemistry classes.
Theoretically, however, helium can form a single bond with fluorine, but this is a very unstable configuration as the helium atom will then have one unpaired electron.
When hydrogen participates in ionic bonding, it wil always be the anion. This group of comounds are called metal hydrides. In them, hydrogen atoms gain one electron and become hydride ions, \(H^{-}\).
Example 1: Sodium hydride is \(NaH\). Sodium most easily gets a full octet by losing one valence electron, so the sodium ion is \(Na^{+}\), so it bonds with hydride ions in a 1:1 ratio.
Example 2: Magnesium hydride is \(MgH_2\). Magnesium tends to form \(+2\) cations most easily as this requries the transfer of the fewest electrons. As we discussed earlier, hydride ions have a \(-1\) charge, so we need two of them to balance out the charge of one magnesium cation. Thus magnesium hydride is \(MgH_2\).