This problem also goes under the name of " run of $k$ consecutive successes in $n$ Bernoulli trials" or shortly Bernoulli runs.
It applies to many technical fields, among others in Digital Transmission("error bursts"), System Reliability
( "consecutive k-out-of-n:F systems") and of course, in Queue Systems.
Because of those technical applications, I've been studying this subject for a while.
I will briefly summarize herewith the result directly concerning your question. If you are interested in studying the subject further you may start
from this paper by M. Muselli and this by S. Aki.
Consider a binary string with $s$ "$1$" and $m$ "$0$" in total. Let's put an additional (dummy) fixed $0$ at the start and at the end of the string.
We individuate as a run the consecutive $1$'s between two zeros, thereby including runs of null length: with this scheme we have a fixed number of $m+1$ runs.

If we sequentially enumerate the length of each run so individuated, we construct a bijection with the number of ways of putting
$s$ (undistinguishable) balls into $m+1$ (distinguishable) bins.
Now consider the case in which runs have a max length of $r$ ones, or that the bins have a limited capacity of $r$ balls, or otherwise the
$$N_{\,b} (s,r,m+1) = \text{No}\text{. of solutions to}\;\left\{ \begin{gathered}
0 \leqslant \text{integer }x_{\,j} \leqslant r \hfill \\
x_{\,1} + x_{\,2} + \cdots + x_{\,m+1} = s \hfill \\
\end{gathered} \right.$$
which as explained in this other post is expressed as
$$
N_b (s,r,m + 1)\quad \left| {\;0 \leqslant \text{integers }s,m,r} \right.\quad = \sum\limits_{\left( {0\, \leqslant } \right)\,\,k\,\,\left( { \leqslant \,\frac{s}
{r}\, \leqslant \,m + 1} \right)} {\left( { - 1} \right)^k \left( \begin{gathered}
m + 1 \hfill \\
k \hfill \\
\end{gathered} \right)\left( \begin{gathered}
s + m - k\left( {r + 1} \right) \\
s - k\left( {r + 1} \right) \\
\end{gathered} \right)}
$$
whose generating function in $s$ is
$$
F_b (x,r,m + 1) = \sum\limits_{0\,\, \leqslant \,\,s\,\,\left( { \leqslant \,\,r\,\left( {m + 1} \right)} \right)} {N_b (s,r,m + 1)\;x^{\,s} } = \left( {\frac{{1 - x^{\,r + 1} }}
{{1 - x}}} \right)^{m + 1}
$$
Therefore the number of strings with $s$ "$1$" and $m$ "$0$",
having at least one run of length $r$, and not longer, will be:
$$N_b(s,r,m+1)-N_b(s,r-1,m+1)$$
and those with exactly $q$ runs of length $r$, and none longer, will be:
$$
\begin{gathered}
N_s (s,r,m + 1,q) = \quad \left| {\;\text{integer }s,r,m,q \geqslant 0} \right. \hfill \\
= \left[ {0 = r} \right]\left[ {0 = s} \right]\left[ {m + 1 = q} \right] + \left( \begin{gathered}
m + 1 \\
q \\
\end{gathered} \right)N(s - q\,r_\, ,r - 1,m + 1 - q) = \hfill \\
= \sum\limits_{\left( {0\, \leqslant } \right)\,\,j\,\,\left( {\, \leqslant \,m + 1} \right)} {\left( { - 1} \right)^j \left( \begin{gathered}
m + 1 \\
q \\
\end{gathered} \right)\left( \begin{gathered}
m + 1 - q \\
j \\
\end{gathered} \right)\left( \begin{gathered}
s - q\,r + m - q - jr \\
s - q\,r - jr \\
\end{gathered} \right)} \hfill \\
\end{gathered}
$$
For example, given
$s=5,\;r=2,\;m=2,\;q=2$
we have $N_s=3$, corresponding to the three strings
$1\;1\;0\;1\;1\;0\;1$
$1\;1\;0\;1\;0\;1\;1$
$1\;0\;1\;1\;0\;1\;1$
Finally, to connect to true blue anil's aswer, note that $N_b$ obeys to the recurrence
$$
N_{\,b} (s,r,m + 1) = \sum\limits_{i\, = \,0}^r {N_{\,b} (s - i,r,m)}
$$