In atomic models balls represent an atom
Now if an atom like carbon has four holes it means it can bond with four atoms. It has valency = 4.
The atomic number of carbon is 6
the configuration is 1s2 2s2 2p2
So due to four valence electrons it can bind with four other atoms and thus we have four holes in carbon ball
The hydrogen show a valency of one
the atomic number of hydrogen = 1
its configuration is 1s1
So it can bind with one atom (max) thus we have one hole in hydrogen ball