first shell only has an s sub-shell and thus can hold a max of 2 electrons.
second shell has an s and p sub-shell and thus can hold a max of 8 electrons.
third shell has an s, p, and d sub-shell and thus can hold a max of 18 electrons.
fourth shell has an s,p,d, and f sub-shell, and thus can hold a max of 32 electrons.