Ionic compounds are formed between metals and non-metals.
Covalent compounds are formed between non-metals.
Metallic compounds are formed between metals
Electronegativity it is the tendency of an atom to attract electron more towards it self. If electronegativity difference between atoms is more then it form ionic bond and if it is less then it forms covalent bond.
If the difference is between 0.0 to 0.4 it will form nonpolar covalent bond
If the difference is between 0.4 to1.7 it will form polar covalent bond
If it is >1.7 it will form ionic bond
Ionic compound will have high melting point and conduct electricity. Covalent compounds it has low melting point. Ionic compounds are crystalline solid and covalent compounds exists in three different states of matter that is solid liquid and gases at STP.
Ionic compound = NaCl, CaCO3, Na2O, KNO3...
Covalent compound = H2O, NH3, Ccl4...
If electronegativity difference between 2 elements is 1.7 or greater than 1.7 it is ionic bond.
in other words, if constituent elements are metal and non metal it is ionic bond.
if electronegativity difference between 2 elements is below 1.7 the bond formed is covalent bond
eg: oxygen - 3.5
chlorine - 3
nitrogen - 2.7
sodium - 0.90
so difference btw sodium and chlorine is ( nacl)
3.00 - 0.90 = 2.1
2.1 is greater than 1.7
so the bond formed is ionic bond.
You can tell whether it is ionic or covalent by knowing if the elements that were bonded were metal or non-metal. For example:
Ionic= Metal + Nonmetal
Covalent= Nonmetal + Nonmetal
*There are some exceptions to theabove rules however, so you should go look at the exceptions to the rule*