Energy level (shell) occupancy

How many electrons can occupy each energy level (shell)?
In general, energy levels (shells) further from the nucleus can be occupied by more electrons.
The maximum number of electrons in the various energy levels (shells)for the first twenty elements is given below:
 
Energy level 1 (shell 1): 2 electrons
Energy level 2 (shell 2): 8 electrons
Energy level 3 (shell 3): 8 electrons
*In advanced chemistry courses you will learn that for elements having atomic number greater than 20, the energy levels (shells) 3 and 4 may contain more than 8 electrons.
 
Note that the maximum number of electrons in each of the first three energy levels (shells) (2, 8, 8)  is the same as the maximum number of elements in each of the first three rows of the periodic table (2, 8, 8).
12
 1H2He
3Li4Be 5B6C7N8O9F10Ne
11Na12Mg13Al14Si15P16S17Cl18Ar
19K20Ca21Sc22Ti23V24Cr25Mn26Fe27Co28Ni29Cu30Zn31Ga32Ge33As34Se35Br36Kr

The first four periods (rows) of the periodic table are shown.
These contain many important elements.

How to predict the number of occupied energy levels (shells)?
In the ground (lowest energy) state for any atom, the electrons on the atom occupy the lowest energy levels (shells) available.

Row 1 elements have either 1 or 2 electrons.
All electrons are in energy level 1 (shell 1).
Row 2 elements have between 3 and 10 electrons. 
Two electrons are energy level 1 (shell 1); the rest are in energy level 2 (shell 2). 
Row 3 elements have between 11 and 18 electrons.
Two electrons are in energy level l (shell 1).
Eight electrons are in energy level 2 (shell 2).
The remaining electrons are in energy level 3 (shell 3).