Carbon forms largest no. of compounds because-
i) Catenation - (Self linking property) It means carbon can link to other carbon atoms due to sharing of electrons. This property is shown byonly Carbon atom which is not shown in any other compound to this extent whichleads to the property of isomerisation.
ii) Tetravalency - (having four valence electron) You can say that, carbon is the only element which is so reactive and can react to any element according to lesson Modern periodic table, as it is mentioned that as we move down to the periodic table the reactivity decreases. so carbon is the smallest element of them and hence it share electrons to this extent as it can neither gain nor can lose any electron. this made it possible.