8. $\frac{13}{128}$.

From $S_{2} \neq 0$, we know that the first two flips are either both heads or both tails.

When the first two flips are both heads, by $S_{8}=2$, we know that in the next six flips, there must be three heads and three tails, the probability of which is
$$
P_{1}=\left(\frac{1}{2}\right)^{2} \mathrm{C}_{6}^{3}\left(\frac{1}{2}\right)^{6}=\frac{5}{64} \text {. }
$$

When the first two flips are both tails, by $S_{8}=2$, we know that in the next six flips, there must be five heads and one tail, the probability of which is
$$
P_{2}=\left(\frac{1}{2}\right)^{2} \mathrm{C}_{6}^{5}\left(\frac{1}{2}\right)^{6}=\frac{3}{128} .
$$

Therefore, the required probability is $P_{1}+P_{2}=\frac{13}{128}$.
8. A person tosses a coin, with the probability of landing heads up and tails up being $\frac{1}{2}$ each. Construct the sequence $\left\{a_{n}\right\}$ such that
$$
\begin{array}{l}
a_{n}=\left\{\begin{array}{ll}
1, & \text { if the } n \text {th toss is heads; } \\
-1, & \text { if the } n \text {th toss is tails. }
\end{array}\right. \\
\text { Let } S_{n}=a_{1}+a_{2}+\cdots+a_{n} . \text { Then } S_{2} \neq 0, \text { and } S_{8}=2
\end{array}
$$

The probability is $\qquad$ (answer in simplest fraction form).