Let the grid of points be referred to as the cube. Any line parallel to an edge of the cube and containing two of the grid points must contain $10$ of the grid points. Thus no line parallel to an edge of the cube contains exactly $8$ of the grid points. There are $30$ planes, each parallel to a face of the cube and each containing $100$ of the grid points in a $10 \times 10$ square. The points of this grid determine $4$ lines that each contain exactly $8$ grid points. These lines are two units above and two units below each of the diagonals of each such square. Now consider a line that is not parallel to an edge or a face of the cube and contains exactly $8$ grid points. A vector parallel to such a line has the form $(a, b, c)$, where $a, b$, and $c$ are nonzero integers that have no common factor greater than $1$. The line has equation \[ (x, y, z) = (d, e, f) + t(a, b, c), \] where $d, e$, and $f$ are integers, and there are $8$ consecutive integer values of $t$ such that $x = at + d$, $y = bt + e$, and $z = ct + f$ are all integers between $1$ and $10$, inclusive. It follows that each of $a, b$, and $c$ must be $\pm 1$; without loss of generality, assume $a = 1$. Then there are four possible vectors that can be parallel to a line containing exactly $8$ grid points: $(1, 1, 1)$, $(1, 1, -1)$, $(1, -1, 1)$, $(1, -1, -1)$. Each of these four vectors is parallel to one of the space diagonals of the cube. By symmetry, it suffices to find the number of lines parallel to the vector $(1, 1, 1)$, and then multiply this result by $4$. The lines parallel to $(1, 1, 1)$ must intersect the grid in a point on one of the planes $x = 1$, $y = 1$, or $z = 1$. Then any one of the 8-point lines has the form \[ (d, e, f) + t(1, 1, 1) = (d + t, e + t, f + t), \] and the $8$ grid points are realized for $t = 0, 1, 2, \ldots, 7$. Each of the coordinates $d + t$, $e + t$, and $f + t$ is between $1$ and $10$, inclusive, for these values of $t$, and at least one of these numbers is $11$ when $t = 8$. Thus at least one of $d, e$, and $f$ is $1$, at least one is equal to $3$, and the third is $1, 2$, or $3$. If two of $d, e$, and $f$ are equal to $1$, then $(d, e, f)$ is one of the triples $(1, 1, 3)$, $(1, 3, 1)$, or $(3, 1, 1)$. If two of $d, e$, and $f$ are equal to $3$, then $(d, e, f)$ is one of the triples $(1, 3, 3)$, $(3, 1, 3)$, or $(3, 3, 1)$. If $d, e$, and $f$ are distinct, then there are $3! = 6$ possibilities for $(d, e, f)$. This accounts for $12$ possibilities for $(d, e, f)$. Thus the number of lines containing exactly $8$ of the lattice points is $4 \cdot 30 + 4 \cdot 12 = 168$.