This is a difficult problem. Let's start with the N condition. As often a possible way to simplify the problem is to instead calculate the chance of never X occurences in a row given Y trials.
Note that for $Y < X$ you will never have X occurences, much less in a row, so the probability here is 1. Let us denote the probability that you do NOT have X occurences in a row given Y trials as $P(X|Y)$.
Since we assume a coin, let's call the two outcome H and T. T are our successes. Let us shorten a repetion of n heads or tails as H[n] respectively T[n]. Let us furthermore denote the chance of T as p. Look at the cases which do not contain a T[X]. They have the following possible starts (first few events):
$$
H \\
T[1]H \\
T[2]H \\
\vdots \\
T[X-1]H
$$
Note that they seperate the room of possible outcomes, it's not possible for a series to start with two of those options, they are mutually exclusive. So we can write
$$
P(X|Y) = \sum_{i=0}^{X-1} P(\text{series starts with $T[i]H$ and no $T[X]$ in rest of series)}
$$
because of independence of the individual events we get
$$
P(X|Y) = \sum_{i=0}^{X-1} P(\text{series starts with $T[i]H$})P(\text{no $T[X]$ in rest of series}).
$$
Note that the rest of the series depends on i; it has length $Y-i-1$. So finally we get
$$
P(X|Y) = \sum_{i=0}^{X-1} (1-p)p^{i-1}P(X|Y-1-i).
$$
This is a well-defined recurrent formula given $P(X|Y) = 1$ for $Y < X$. While there is (as far as I know) no general closed form, it is easy enough to calculate. Remember that the chance you seek is actually $1-P(X|Y)$.
Now if could still condition on the total number of sucesses... This could probably be carried along with the Y. I will try to complete that part later. The number of reamining sucesses in the recurrence part of the formula will decrease by i but the inversion part will be tricky...
Okay, let's give this a try. We now look at $P(X,N|Y)$. It stands for the probability of having exactly n successes and no chains of length X or more in a sequence of length Y.
We still get
$$
P(X,N|Y) = \sum_{i=0}^{X-1} (1-p)p^{i-1}P(X,N-i|Y-1-i).
$$
Do we have enough boundary conditions on $P(X,N|Y)$ to make this work? We do know that $P(X,N|Y)$ is $\binom{Y}{N}p^N(1-p)^{N-Y}$ for $Y < X$ and $N \leq Y$. It's also 0 if $Y=N$ AND $Y \geq X$.Is that enough? Let's look at an easy example $X=2$,$Y=4$,$N=3$,$p=0.5$.
We get
$$
P(2,3|4) = (1-p)P(2,3|3)+p(1-p)P(2,2|2)
$$
So we get
$$
(1-p)0+p(1-p)0=0.
$$
Works in this case.
Let's try $N=4$, $Y=5$, $X=3$, $p=0.5$.
$$
P(3,4|5) = (1-p)P(3,4|4)+p(1-p)P(3,3|3)+p^2(1-p)P(3,2|2)
$$
The first two terms are zero (see above), so what remains is $2^{-5}\binom{2}{2}$.
You get your probability by
P(exactly N sucesses) = P(exactly N successes + no chains of length X) + P(exactly N successes + chains of length X). The left hand is simply given by the binomial theorem.
....so the right-most probability:
$$
\frac{5}{2^5} = \frac{1}{2^5}+P(\text{chain of length X exists},N|Y)
$$
so
$$
P(\text{chain of length X exists},N|Y)=\frac{4}{2^5}.
$$
Now just divide by the probability of exactly N successes to get the conditional probability of $\frac{4}{5}$, which is the correct answer.
I think the recurrency and the formula is well defined, but I am not 100% certain at this point.
R-Version, which after some bug-fixes seems to agree with Max, but might me more general, if slow. chance2 gives the final result. I have also tested the results of the function and compared it to simulation. It seems to provide the correct answer. Caching the values in a two-dimensional array for L,N could make the program relatively fast.
chance <- function(x,L,N)
{
print(c(x,L,N))
if (L < 0) return(0)
if (N <0) return(0)
if (L < N) return(0)
if (L == 0)
{
if (N!=0) return(0)
return(1)
}
if (L < x)
{
return(0.5^(L)*choose(L,N))
}
result <- 0
for (i in 0:(x-1))
{
result <- result + 0.5^(i+1)*chance(x,L-i-1,N-i)
}
return(result)
}
chance2 <- function(x,L,N)
{
result1 <- chance(x,L,N)
left.hand <- choose(L,N)*(0.5)^L
result2 <- (left.hand-result1)/left.hand
return(result2)
}