The correct option is C 2,8,2
As we know, atomic no. is the total no of proton present in nucleus of an atom and atomic mass no is the total no of proton and neutron.
So Mg have atomic no. 12 and mass no. 12+12=24. K shell can accommodate a maximum of 2 electrons, L shell can accommodate a maximum of 8 electrons. Remaining electrons will be accommodated in M shell. So the configuration is 2,8,2.