Each atom in the 2D lattice representation has 4 valence electrons. Each atom has also 4 perpendicular neighbors. If you draw 4 electrons around each atom's nucleus, you'll get 2 shared in the space between each atom and its perpendicular neighbor.