Two nonmetals have enough electrons to share some for completing, so the bonds are covalent. A metal doesn't have that much, so it gives the few electrons on its outer layer more easily than a nonmetal (there must be a nonmetal to get them). This bond is ionic.
I'm still unaware of possible bonds between 2 metals (are there any? :) )