The rules for distribution of electrons in various shells are:
The maximum number of electrons present in a shell is given by the formula 2n2, where 'n' is the orbit.
The maximum number of electrons that can be accommodated in the outermost orbit is 8.
Electrons are not accommodated in a new shell, unless the inner shells are filled. That is, the shells are filled in a step-wise manner.