The Aufbau principle states that, hypothetically, electrons orbiting one or more atoms fill the lowest available energy levels before filling higher levels (e.g., 1s before 2s). In this way, the electrons of an atom, molecule, or ion harmonize into the most stable electron configuration possible.
Electron behavior is elaborated by other principles of atomic physics, such as Hund's rule and the Pauli exclusion principle. Hund's rule asserts that even if multiple orbitals of the same energy are available, electrons fill unoccupied orbitals first, before reusing orbitals occupied by other electrons. But, according to the Pauli exclusion principle, in order for electrons to occupy the same orbital, they must have different spins.
The order in which these orbitals are filled is given by n+l rule known as Madelung Rule or diagonal rule.Orbitals with a lower (n+l) value are filled before those with higher (n+l) values where n represents principal quantum number and l represents azimuthal quantum number.
The fact that most of the ground state configurations of neutral atoms fill orbitals following this n + ℓ, n pattern was obtained experimentally, by reference to the spectroscopic characteristics of the elements.
The Madelung energy ordering rule applies only to neutral atoms in their ground state,even in some cases there are examples which show different electronic configuration than those of experimentally determined.Copper,Chromium and Palladium are common examples of this rule.
For Palladium,according to Madelung's rule, 5s^2 has lower (n+l) value i.e. (5+2=7) and 4d^8 has higher (n+l) value i.e. (4+8=12),so the 5s orbital fills up first before 4d orbital.
Hence, Palladium shows anomalous electronic configuration.