Why does carbon form a large number of compounds?
Tetravalency
Multiple bonds formation
Property of catenation
Having the atomic number 6, every carbon atom has a total of six electrons. Two are in a completed inner orbit, while the other four are valance electrons—outer electrons that are available for forming bonds with other atoms (tetravalency).
The second reason is carbon forms a large number of compounds is the catenation which ability of carbon to link with itself not only in straight chains but also in complex branchings.
The third reason is multiple bond formation which means that carbon atoms can share not only a single electron with another atom to form a single bond, but it can also share two or three electrons, forming a double or triple bond. This makes for a huge number of possible bond combinations at different places, making a huge number of different possible molecules. And a molecule that differs by even one atom or one bond position is a molecule of a different compound.