Cerium in $0$ oxidation state has electronic configuration
$$[\ce{Xe}]\mathrm{(4f)^1(5d)^1(6s)^2}$$
But when it gets oxidised to $+2$ state, it becomes
$$[\ce{Xe}]\mathrm{(4f)^2(5d)^0(6s)^0}$$
This is a change as in other elements in the lanthanides series get their $\mathrm{6s}$ electrons abstracted and the other shells remain at liberty. Could you please explain this phenomenon to me? And also correct me if anything unsaid above was incorrect.