Here's what I understand about quantum number and orbitals, please correct me if anything is wrong:
Electrons enter into these different types of orbitals because they have a higher/lower amount of energy, and we know that the number of electrons varies from element to element along with the energy levels of those electrons in a pretty linear way, conveniently allowing us to organize them into blocks on the periodic table where their highest energy level electron is in one of the many types of orbitals (spdf). I know the energy shell occupied by an electron (the principle quantum number) corresponds with the angular momentum quantum number which determines the magnetic quantum number, which determines the type of orbital an electron is in. I know that all of that is because the electrons in higher energy shells/levels have more energy are thus more likely to be in an orbital such as d or f as opposed to an s or p orbital, for example.
Note that I don't know why the orbitals exist in the exact shapes they do (although I imagine it has something to do with the electrons speeding up or slowing down at certain points making it more likely for us to discover it in a certain spot), or what the threshold is for the amount of energy required to make an electron move into the next type of orbital (d to f, for example).
But, I have one question: why does a neutral beryllium atom with 4 electrons in 2 energy shells/levels not have any electrons in a p orbital?
My reasoning is as follows:
If $n = 2$ where $n$ is the energy shell occupied by beryllium's fourth electron, then $l = 0,1$ and $m_l = \text{either }0 \text{ or }-1,0,1$. If $m_l = -1,0,1$. Then, why isn't this fourth electron in a p orbital?