Realization of a two-site Z2 lattice gauge theory