This is based on the Pauli Exclusion Principle, which states that no two electrons in an atom can have the same set of four quantum numbers.
* n (principal quantum number) describes the electron shell.
* l (angular momentum quantum number) describes the subshell (shape of the orbital).
* ml (magnetic quantum number) describes the orientation of the orbital in space.
* ms (spin quantum number) describes the intrinsic angular momentum of the electron, which can be spin up (+1/2) or spin down (-1/2).
Since the spin quantum number can only have two values, an orbital can only hold a maximum of two electrons, one with spin up and one with spin down.