We know that there are basically four different type of shells, each of which has different capacity to hold the maximum number of electrons.
The K shell can hold a maximum of two electrons,
the L shell can hold a maximum of 8,
M a maximum of 18 and N a maximum of 32.
Even though the M shell has the capacity to hold 18 electrons it cannot hold more than eight electrons. Thus as soon as the number of electrons in the M shell exceeds eight, the filling of the next shell ( that is N) takes place. This is why the electronic configuration of calcium is 2, 8, 8, 1 and not 2, 8, 9, 1.