I am a beginner and am learning about atomic structure and I am getting confusions regarding the aufbau principle.
It is said that the electrons will be filled first in lowest available energy level. But according to aufbau principle electrons are filled in $\mathrm{4s}$ orbital before filling the $\mathrm{3d}$ orbital. Similarly,electrons are filled in $\mathrm{5s}$ before $\mathrm{4f}$.
But I am also taught that if $n$(principle quantum number) increases,the size of the orbital also increases. By size I mean the maximum distance from the nucleus.
So accordingly, $\mathrm{4s}$ orbital should have greater size than $\mathrm{3d}$. Similarly $\mathrm{5s}$ should have greater size than $\mathrm{4f}$. Hence $\mathrm{4s}$ as well as $\mathrm{5s}$ are farther from nucleus as compared to $\mathrm{3d}$ and $\mathrm{4f}$ respectively. Thus they have more total energy and hence electrons should be filled in $\mathrm{3d}$ and $\mathrm{4f}$ before $\mathrm{4s}$ and $\mathrm{5s}$ respectively.
But the above stated doesn't happen. My confusion is, "Why isn't this line of thinking correct?"
Here is a diagram depicting that $\mathrm{4s}$ is bigger than $\mathrm{3d_{xy}}$.