  For a locally compact second countable group G and a lattice subgroup Gamma,
we give an explicit quantitative solution of the lattice point counting problem
in general domains in G, provided that i) G has finite upper local dimension,
and the domains satisfy a basic regularity condition, ii) the mean ergodic
theorem for the action of G on G/Gamma holds, with a rate of convergence. The
error term we establish matches the best current result for balls in symmetric
spaces of simple higher-rank Lie groups, but holds in much greater generality.
In addition, it holds uniformly over families of lattices satisfying a uniform
spectral gap. Applications include counting lattice points in general domains
in semisimple S-algebraic groups, counting rational points on group varieties
with respect to a height function, and quantitative angular (or conical)
equidistribution of lattice points in symmetric spaces and in affine symmetric
varieties. The mean ergodic theorems which we establish are based on spectral
methods, including the spectral transfer principle and the Kunze-Stein
phenomenon. We prove appropriate analogues of both of these results in the
set-up of adele groups, and they constitute a necessary step in our proof of
quantitative results in counting rational points.
