Answer
Na: $1s^{2}$ $2s^{2}$ $2p^{6}$ $3s^{1}$
Mg: $1s^{2}$ $2s^{2}$ $2p^{6}$ $3s^{2}$
Al: $1s^{2}$ $2s^{2}$ $2p^{6}$ $3s^{2}$ $3p^{1}$
Si: $1s^{2}$ $2s^{2}$ $2p^{6}$ $3s^{2}$ $3p^{2}$
P: $1s^{2}$ $2s^{2}$ $2p^{6}$ $3s^{2}$ $3p^{3}$
S: $1s^{2}$ $2s^{2}$ $2p^{6}$ $3s^{2}$ $3p^{4}$
Cl: $1s^{2}$ $2s^{2}$ $2p^{6}$ $3s^{2}$ $3p^{5}$
Ar: $1s^{2}$ $2s^{2}$ $2p^{6}$ $3s^{2}$ $3p^{6}$
Work Step by Step
Aufbau's principle is used to determine which orbital will be filled next. Each S orbital can hold only 2 electrons and p orbital can hold only 6 electrons. So as one orbital is filled, the electrons occupy the next orbital . Orbital 3s gets filled after Mg. As the next energy level is 3p and p can hold 6 electrons the electrons start filling p orbital, till it gets completely filled (Ar electronic configuration).