Carbon has four electrons to share, and it wants to have eight. Each molecule other than Carbon shares one electron each, so with the four electrons shared from carbon combined with the four electrons shared by the other atoms, there are eight electrons shared in total.