Pauli was the first to propose an additional quantum number (the fourth), in order to explain the behavior of atomic orbitals, which seemed to indicate that they could contain, at most, two electrons, suggesting that electrons could only reside within the same orbital, if their respective values for this quantum number was different: this is the exclusion principle.
The issue now was giving physical meaning to this value. There was a general idea that the electron may possess some sort of rotation, around its own axis, with Dirac finally suggesting that if electrons are constrained to one of two possible values, perhaps this explains why orbitals have a "max occupancy" of two electrons.