Here's how to determine the name:
* Magnesium (Mg) is a metal and forms a positive ion (Mg²⁺).
* Phosphorus (P) is a nonmetal and forms a negative ion (P³⁻).
* To balance the charges, we need three magnesium ions (3 x +2 = +6) and two phosphide ions (2 x -3 = -6).
* The name of the compound is formed by combining the names of the metal cation (magnesium) and the nonmetal anion (phosphide) with the suffix "-ide".