Some transition metals don't follow the aufbau, because half-filled orbitals and completely filled orbitals are associated with the stability of the element.
For example, For Cu with Z=29
If we follow aufbau, its condensed electronic config should be
[Ar] 4s² 3d⁹ . But because half-filled orbitals and complete orbitals are more stable, an electron from the s-sublevel will transfer to the d-sublevel. Thus, [Ar] 4s¹ 3d¹⁰. Here, the s-sublevel is half-filled and the d-sublevel is completely filled.