For $i=1,\ldots,r,\;$ define event $B_i = \text{"First tail occurs on $i^{th}$ toss"}$. Since the process ends after $r$ successive heads then, given initially that $A=H$, exactly one of these $r$ events must occur.
Note that, given $A=H$, if $B_r$ occurs then $E$ also occurs, which is to say $P(E\mid B_r\cap A=H) = 1$. Also, given $A=H$, if any of the other $B_i$ events occur then it is like we are starting over but, instead, initially given $A=T$. Therefore, conditioning on whether or not $B_r$ occurs,
\begin{eqnarray*}
P(E\mid A=H) &=& P(E\mid B_r\cap A=H)P(B_r\mid A=H) + P(E\mid B_r^c\cap A=H)P(B_r^c\mid A=H) \\
&& \\
&=& p^{r-1} + P(E\mid A=T)(1-p^{r-1}). \qquad\qquad\qquad\qquad\qquad(1) \\
\end{eqnarray*}
$\\$
Next, we can find $P(E\mid A=T)$ by way of $P(E^c\mid A=T)$ and that is found in a similar way to $P(E\mid A=H)$.
For $i=1,\ldots,s,\;$ define event $C_i = \text{"First head occurs on $i^{th}$ toss"}$. Then,
\begin{eqnarray*}
P(E\mid A=T) &=& 1 - P(E^c\mid A=T) \\
&& \\
&=& 1 - [P(E^c\mid C_r\cap A=T)P(C_r\mid A=T) + P(E^c\mid C_r^c\cap A=T)P(C_r^c\mid A=T)] \\
&& \\
&=& 1 - [1\cdot (1-p)^{s-1} + P(E^c\mid A=H)(1-(1-p)^{s-1})] \\
&& \\
&=& 1 - [(1-p)^{s-1} + (1 - P(E\mid A=H))(1-(1-p)^{s-1})] \\
&& \\
&=& (1-(1-p)^{s-1}) P(E\mid A=H). \qquad\qquad\qquad\qquad\qquad(2) \\
&& \\
\end{eqnarray*}
We now proceed to find $P(E)$. Substitute $(2)$ into $(1)$:
\begin{eqnarray*}
P(E\mid A=H) &=& p^{r-1} + (1-p^{r-1}) (1-(1-p)^{s-1}) P(E\vert A=H) \\
&& \\
\therefore P(E\mid A=H) &\times& (p^{r-1} - p^{r-1}(1-p)^{s-1} + (1-p)^{s-1}) \;\; = \;\; p^{r-1} \\
&& \\
P(E\mid A=H) &=& \dfrac{p^{r-1}}{p^{r-1} - p^{r-1}(1-p)^{s-1} + (1-p)^{s-1}} \qquad\qquad\qquad(3) \\
\end{eqnarray*}
Substitute this into $(2)$:
\begin{eqnarray*}
P(E\mid A=T) &=& \dfrac{p^{r-1} - p^{r-1} (1-p)^{s-1}}{p^{r-1} - p^{r-1}(1-p)^{s-1} + (1-p)^{s-1}} \qquad\qquad\qquad(4) \\
\end{eqnarray*}
$\\$
Finally, using results $(3)$ and $(4)$,
\begin{eqnarray*}
P(E) &=& P(E\mid A=H)P(A=H) + P(E\mid A=T)P(A=T) \\
&& \\
&=& \dfrac{p^r + p^{r-1}(1-p) - p^{r-1} (1-p)^s}{p^{r-1} - p^{r-1}(1-p)^{s-1} + (1-p)^{s-1}} \\
&& \\
&=& \dfrac{p^{r-1} - p^{r-1} (1-p)^s}{p^{r-1} - p^{r-1}(1-p)^{s-1} + (1-p)^{s-1}}.
\end{eqnarray*}
So we have to calculate the probabilities of both, and see what we get.
The probability that there is at most one tail is the probability that there are $3$ heads $=(\frac{1}{2})^3 = \frac{1}{8}$ plus the possibility of $1$ tail, which can come on any of the three flips, ($=\frac{1}{8}*3 = \frac{3}{8}$), which is $1/2$.
The probability that both a heads and a tails is present is the opposite of either all turning up heads or all turning up tails, which comes out to be $\frac{6}{8}=\frac{3}{4}$.
Now we have to calculate the probability of both the above happening i.e. both a head and tail turn up, and there is at most one tail. This is the same as saying that exactly one tail turns up. The probability of that happening is $\frac{3}{8}$.
Independence of two events $A$ and $B$ happens when $P(A)P(B)=P(A \cap B)$. In this case, $\frac{1}{2} \cdot\frac{3}{4}$ is equal to $\frac{3}{8}$, whence the events are independent. Please ask if any doubts.
Best Answer
After the first bad event one has $x\geq1$ dollars in the pocket. The question is whether one shall go on playing. Denote by $E(x)$ the expected total win under the best strategy in this situation. If we decide to quit we have won $x$, and if we make a next turn we have (with probability ${3\over4}$) won $x+1$ and the possibility of further play, or (with probability ${1\over4}$) we have won $0$. This shows that $$E(x)=\max\left\{x, \ {3\over4}E(x+1)\right\}\ .\tag{1}$$ I'm assuming (without proof) that there will be an $n$ where we definitely won't play once more; hence $E(n)=n$. From this and $(1)$ we get $$E(n-1)=\max\left\{n-1,\ {3\over4}n\right\}=n-1\qquad(n\geq4)\ .$$ By downwards induction it follows that $$E(n)=n\qquad(n\geq 3)\ .$$ Using $(1)$ one then computes $$E(2)=\max\left\{2,\ {3\over4}E(3)\right\}={9\over4}\ ,\qquad E(1)=\max\left\{1,\ {3\over4}E(2)\right\}={27\over16}\ .$$ This means that one should play on when $1\leq x\leq2$, and quit otherwise.