Electrons in an atom can only have certain fixed energies, called energy levels. When an excited electron falls from a higher level to a lower one, the atom emits a photon whose energy equals the difference between the two levels. This gives a line spectrum: bright lines of certain frequencies only. A continuous spectrum contains every frequency.
In the hydrogen spectrum the lines in each series get closer together at high frequency. This shows that the energy levels converge as n increases.
Each main level is split into sublevels (s, p, d, f) made of orbitals. Each orbital holds at most two electrons with opposite spins. Electrons fill the lowest energy orbitals first, and orbitals of equal energy are filled singly before any pairing.