Electrons live in shells — and the shells fill in a fixed order.
Electrons fill shells around the nucleus. Each shell holds 2n² electrons — 2, 8, 18, 32.