To find the valency of carbon there is an formula given by bohrs model of an atom which is 2n^2 in which n is the no. of the shells
We can find the valency of an element by the use of electronic configuration :
Electronic configuration refers to the no. of electrons present in one shell i.e. K,L,M,N are the shell 

E.G. sodium :- electronic configuration -- K  L  M
                                                                  2  8  1
so here in last shell there is 1 electron , so sodium can give one electron to complete its octave and to become stable .

hope it help u
pls mark it as brainliest answer

1 5 1