Counting Rational Points on Algebraic Varieties, the Determinant Method and Applications