C and C have an electronegativity difference of 0. So they would definitely form covalent bond
For Mg and Cl, you don't even need electronegativity difference. Mg is a metal whereas Cl is a non metal. Most bonds between a metal and a non metal are ionic bonds