What is a quantum number?
A quantum number is a value that one must assign to a subatomic particle (such as an electron) when solving the Schroedinger equation for the wavefunction (the mathematical description of the state) of the electron.
Schroedinger's equation is a complex mathematical relation that essentially amounts to writing the law of conservation of energy in wave mechanics.
The solutions generated by this equation describe the electrons in an atom by giving what are known as wavefunctions.
As one works through the solutions (and it is a BIG mathematical undertaking), at various points, you must state a value for a fundamental aspect of the electron's behaviour. There are four such values encountered this way, and each is called a quantum number.
The first, or principal quantum number describes the energy of the electron (and gives rise to the shell it occupies). It can have only positive integer values (1, 2, 3, etc.) Anything else, and the Schroedinger equation does not give an answer that is "well behaved" (but what that means is another story altogether).
The second (the azimuthal quantum number) gives the angular momentum of the electron, and specifies the subshell of the electron. The third is the magnetic quantum number which indicates the specific orbital of the electron, and the fourth gives the spin of the particle. There are only two possible spin values (+1/2 or "up" and -1/2 or "down").
Once all four have been specified, the electron is uniquely described for that atom. It is not possible for two electrons in the same atom to be "identical", which would require that they have the same four quantum numbers. At least one must differ. This is known as the "exclusion principle". Hence there can be only two electrons in each orbital.