We prove that, in a setting of local Dirichlet forms on metric measure spaces, a two-sided sub-Gaussian estimate of the heat kernel is equivalent to the conjunction of the volume doubling propety, the elliptic Harnack inequality and a certain estimate of the capacity between concentric balls. The main technical tool is the equivalence between the capacity estimate and the estimate of a mean exit time in a ball, that uses two-sided estimates of a Green function in a ball