The short answer is Mg; the Noble gas shorthand for it is.
When trying to determine the electron configuration of any ground state atom, there are two things to remember:
The Aufbau principle states that electrons will populate the atomic orbitals with the lowest energy first. The Aufbau principle has two parts. The Klechkowsky’s rule is the first. It states that electrons should be assigned in an order of increasing value. The Aufbau principle’s second section is applicable in the event of a tie. The following diagram summarizes these two rules. It shows diagonal arrows that point to the bottom-left corner. These arrows will indicate the progression of filling the orbitals as per the Aufbau principle.
The order would be
If you have the periodic tables of elements, you can track your way through periods to determine the electron configuration for Magnesium. When moving through the periodic table, it is important to note that the main group elements still have the same principal quantum number. However, the transition metals must be regarded as and the inner transition metals as.