Electrons were believed to be particles until Louis de Broglie in 1924 suggested they have wavelike properties as well. A few years later Schrödinger calculated the energy of an electron in a hydrogen atom by using an equation that treated the electron like a wave. He obtained a series of energy levels, instead of a single energy — which means we can't tell where exactly an electron is located. We can only know where the electron is likely to be.
Classical (Newtonian) Structure 
The basic electronic structure of atoms is that of energy levels, also called shells. These levels are certain distances away from the nucleus of the atom; the higher the level, the higher the energy of the electrons. The first energy level can hold up to two electrons, the second can hold up to eight, the third can hold 18, the fourth can hold 32, and shell n can hold 2n2 electrons. For neutral atoms (those with no charge (not ions)), the number of electrons is equal to the atomic number of the atom.
Quantum numbers 
There are a set of four dimensionless quantum numbers associated with each electron in an atom. The principle quantum number is n, as mentioned above, and it is limited to positive integer values. The azimuthal quantum number l has a value of at most n-1, and it must be a non-negative integer (0 is a possible value). The magnetic quantum number ml may range from -l to +l in value. The spin project quantum number ms is the only one of the four whose domain does not depend on n, and it may only have values of either +1/2 or -1/2.
Subshell nomenclature 
Where l=0, the electron subshell is an s orbital. Where l=1, the electron subshell consists of 3 p orbitals. Where l=2, the electron subshell consists of 5 d orbitals. Where l=3, the electron subshell consists of 7 f orbitals. In hypothetical atoms, where l=4, the electron subshell is 9 g orbitals. The number of orbitals of a kind in the subshell is the number of possible ml values that subshell has. The higher the value of l for a particular subshell kind, the higher the n value must be for that subshell to exist at that energy level. This is because l has a maximum value of n-1, and for a particular kind of orbital, n must be a minimum value so l can have the requisite value.
The Pauli Exclusion Principle states that no two electrons in the same atom may have the same set of quantum numbers. Therefore, only two electrons at most may occupy any single orbital, because each orbital has the same n, l, and ml values, leaving only ms to vary (which only has two possible values).
Each subshell is denoted by n[orbital]; hydrogen's electron, for example, lies in the 1s orbital. Because each orbital can hold two electrons, the maximum number of electrons in a particular subshell is the number of orbitals in that subshell times 2. For example, the 2p and 3p subshells may each hold 2 electrons/orbital*(3 p orbitals)=6 electrons.
The Aufbau Principle states that the lowest-level subshells are filled before higher-level subshells in the ground state of the atom. For example, helium has 2 electrons total, and they fit into the 1s level. If either were in the 2s subshell, this would not be the ground state because the 2s subshell is filled before the 1s subshell is completely filled.