Lower electron shells possess lower energy, and electrons tend to occupy lower shells first, since they are most stable there.
The 1st shell can hold up to 2 electrons.
The 2nd and 3rd shells can hold up to 8 electrons.