Let m and M be the mass of moon and earth respectively which are separated by a distance r.
Force of attraction that earth exerts on moon, Fe = GMm/r²
Force of attraction that moon exerts on earth, Fm = GmM/r²
Thus earth attracts the moon with the same force by which moon attracts the earth. Also the gravitational force is an internal force of attraction between the two bodies, thus they have to be equal.