In 1925, Wolfgang Pauli connected two puzzles: alkali metal doublets and their anomalous Zeeman effect, and the capacities of closed electron shells. His paper assigned the extra two-valued property to the optically active Electron, rather than an angular momentum of the closed core. Its Paschen-Back effect classification used four quantum numbers; these historical labels should not be identified literally with modern . The exclusion rule forbade matching all four. This connected resolved one-Electron states with closed-group populations. An additional test was the missing triplet counterpart of the equivalent two--Electron ground state in alkaline earth metals. Pauli explicitly claimed counts of allowed states, not their energies or ordering.[ref]
https://www.chemteam.info/Chem-History/Pauli-1925/Pauli-1925.html. Pauli 1925, §§1–2: four labels, closed groups, exclusion statement and absent triplet s-term; English translation
The modern question is especially concrete: if a Quantum Hamiltonian has a lowest one-particle state, why cannot every Electron occupy it? Minimizing energy answers which of the allowed quantum states is preferred; the Pauli exclusion principle determines which quantum states are allowed in the first place. Spectral lines then test energy differences between allowed multiparticle quantum states. A line count is not itself a direct count of occupied spin orbitals: transitions also depend on selection rules and the prepared quantum state populations. The observed anomalous Zeeman effect supplied constraints for the historical classification; the two-particle antisymmetrization below supplies the modern mathematical explanation of exclusion.