Pauli exclusion principle, which states that no two electrons in an atom can have the same set of four quantum numbers.
The energy of the electron is specified by the principal, angular momentum, and magnetic quantum numbers. If those three numbers are identical for two electrons, the spin numbers must be different in order for the two electrons to be differentiated from one another.
The two values of the spin quantum number allow each orbital to hold two electrons.
The Pauli exclusion principle specifies limits on how identical quantum numbers can be for two electrons in the same atom.