Two different electronic configurations for cerium
The filling of electrons follows Aufbau principle. However, introduction of $\mathrm{d}$ and $\mathrm{f}$ orbitals and resulting poor shielding affects predicted energy order, and it consists last 2 or three shells incompletely filled. The energy associated with this subshells is nearly same, and one of the subshell of outer shell is bigger in size than subshell of inner shell. So, to perform minimum repulsion between electrons, one or two electrons jump to a bigger subshell (with similar energy) so this exceptions occur.
In case of cerium, energy of $\mathrm{4f}$ and $\mathrm{5d}$ subshells are quite similar and $\mathrm{5d}$ subshell is bigger than $\mathrm{4f}$ subshell. So 1 electron in $\mathrm{4f}$ jump to $\mathrm{5d}$ subshell.