The maximum number of electrons that could be present in a shell is given by the rule 2n2.
Where n is the shell number.
The first shell K shell can accommodate a maximum of 2 electrons (2×12=2).
The second shell L shell can accommodate a maximum of 8 electrons (2×22=8).
Likewise, the 4th shell named N can accommodate a maximum of 32 electrons (2×42=2×16=32).