Electron configuration - shellsWatch
This observation can further be explained by quantum mechanics. The solutions of the Schrodinger and Dirac equations for an atom give the nature of the atomic orbitals, their proximity to the nucleus and also the number of electrons allowed in each shell/sub-shell/orbital. The true solution is such that it also gives the lowest possible energy of that atomic system, so having just 2 electrons in the 1st shell is proven by quantum mechanics to be the most stable an atom can be.
The solutions in a broad sense are also based on electrostatic attraction and repulsion but treat electrons and protons as waves instead of particles. So in a hand-wavey kind of way the same explanation applies.
Also remember the Pauli exclusion principle- each electron must have 4 different quantum numbers