Procedure
To determine the electron configuration for any particular atom, we can build the structures in the order of atomic numbers. Beginning with hydrogen, and continuing across the periods of the periodic table, we add one proton at a time to the nucleus and one electron to the proper subshell until we have described the electron configurations of all the elements. This procedure is called the aufbau principle, from the German word aufbau (“to build up”). Each added electron occupies the subshell of lowest energy available, subject to the limitations imposed by the allowed quantum numbers according to the Pauli exclusion principle. Electrons enter higher-energy subshells only after lower-energy subshells have been filled to capacity. Figure 1 illustrates the traditional way to remember the filling order for atomic orbitals.
Figure 1 This diagram depicts the energy order for atomic orbitals and is useful for deriving ground-state electron configurations.
Consider writing the electron configuration for carbon—an element with atomic number six. Four electrons fill the 1s and 2s orbitals. The remaining two electrons occupy the 2p subshell. We now have a choice of filling one of the 2p orbitals and pairing the electrons or of leaving the electrons unpaired in two different, but degenerate, p orbitals. The orbitals are filled as described by Hund’s rule: the lowest-energy configuration for an atom with electrons within a set of degenerate orbitals is that having the maximum number of unpaired electrons. Thus, the two electrons in the carbon 2p orbitals have identical n, l, and ms quantum numbers and differ in their ml quantum number (in accord with the Pauli exclusion principle). The orbital diagram for carbon, with an electron configuration of 1s22s21p2 is:
Nitrogen (atomic number 7) fills the 1s and 2s subshells and has one electron in each of the three 2p orbitals, in accordance with Hund’s rule. These three electrons have unpaired spins. Oxygen (atomic number 8) has a pair of electrons in any one of the 2p orbitals (the electrons have opposite spins) and a single electron in each of the other two. Fluorine (atomic number 9) has only one 2p orbital containing an unpaired electron. All of the electrons in the noble gas neon (atomic number 10) are paired, and all of the orbitals in the n = 1 and the n = 2 shells are filled.
This text is adapted from Openstax, Chemistry 2e, Section 6.4: Electronic Structure of Atoms.