Answer:
See the explanation below, please.
Step-by-step explanation:
In these cases ionic bonds are formed, between a nonmetal (P, O, F) and a metal (Mg, Si, Cr):
Mg and P
If I
Cr and F
In the case of Hydrogen and Phosphorus, being two nonmetals, they share electrons, forming a covalent bond.