Entanglement of Two Atoms in Insulator and Superfluid States