Based on my understanding, atoms try to achieve the electronic configuration of the nearest noble gas, by losing or gaining electrons. For example, Sodium is closest to Neon, so loses an electron so the outer shell is full (2nd shell is full). This doesn't include the transition metals or the lanthanides or the actinides, which I realize follow something different because of their orbitals.
In the case of Carbon, it is equally distant from Neon as it is from Helium. There's the octet rule, but why exactly does it prefer Neon's configuration over Helium?