Carbon has 4 electrons in its last shell and has a very small size. So to take or to give electrons,it would more or less require the same amount of energy for the atom, therefore, it decided to instead share its electrons with other atoms and hence forms covalent bonds as you said with covalentelements.
The carbon atom is very small due to which its outermost electrons are strongly held by the nucleus. So it is not possible to remove 4 electrons nor it is possible to gain 4 electrons(atomic no-6). since carbon atoms achieve the inert gas electron arrangement only by sharing of electrons.therefore it forms covalent bonds.
The reason for forming large no compounds:-
1) the property of catenation (the ability combine with other atoms)
2) due to its valency 4