There are two main exceptions to electron configuration:
chromium and copper. In these cases, a completely full or half full d sub-level is more stable than a partially filled d sub-level, so an electron from the 4s orbital is excited and rises to a 3d orbital.
Using the Aufbau principle, you would write the following electron configurations
Cr=[Ar]4s23d4
Cu=[Ar]4s23d9
The actual electron configurations are:
Cr=[Ar]4s13d5
Cu=[Ar]4s13d10
To understand why this occurs, it is important to realize that...
1. Completely filled sublevels are more stable than partially filled sublevels.
2. A sublevel which is exactly half filled is more stable than a partially filled sublevel which is not half full.
3. Electrons move in the places of the lowest energy state which is the most stable state.
In both examples, an electron moves from the 4s sublevel to produce a 1/2 full 3d(Cr) or completely filled 3d(Cu). This gives the atom greater stability so the change is favorable.