CHEM 121
Aufbau principle
Electrons fill the lowest-energy subshell available first ("aufbau" is German for building up). The order follows increasing n + l, lower n first for ties: 1s < 2s < 2p < 3s < 3p < 4s < 3d < 4p < …
Potassium: the 19th electron goes into 4s (n + l = 4), not 3d (n + l = 5).
Example
Rubidium (Z = 37) is [Kr] 5s¹: 5s (n + l = 5) fills before 4d (n + l = 6).