Since a neutral atom was requested, its charges must cancel, and therefore, its atomic number must have been #12#.
The neutral atom #"Mg"# has atomic number #Z = 12#, and it indeed has #12# electrons:
- two #1s# electrons
- two #2s# electrons
- six #2p# electrons
- two #3s# electrons
Since #"Mg"# is on group 2, it has two valence electrons that it can donate to form the #"Mg"^(2+)# ion at most (before it becomes energetically unfavorable to donate more, as it is now noble-gas-like).
These donated valence electrons go into making bonds.
A suitable atom, such as---but not limited to---#"Cl"# (from group 17), can accept #"Mg"#'s electrons.
Since each #"Cl"# needs one valence electron, two #"Cl"# atoms can each accept one valence electron to account for #"Mg"#'s two #3s# valence electrons.
Hence, a compound containing #"Mg"# and #"Cl"# would be #\mathbf("MgCl"_2)#, magnesium chloride, where #"Mg"# makes two single bonds by donating its two total valence electrons in conjunction with one valence electron from each #"Cl"#:
#stackrel(..)"Cl"-"Mg"-stackrel(..)"Cl":#
#""^(..) color(white)(iiiiiiiiiiiii)""^(..)#