Let $S_n$ denote the time of the $n$th event of the renewal process $\{N(t),t\geq0\}$ having interarrival distribution F.
I need to find $P(N(t)=n|S_n=y).$
Clearly, if $y$ is the time at which the $n$th event occurs, and if by time $t$, $n$ events have occurred, then $y$ must be less than or equal to $t$. Additionally, I know that $$P(N(t)=n|S_n=y)=\frac{P(N(t)=n,S_n=y)}{P(S_n=y)}$$
What I am not sure how to do is find each of these distributions. I know that $P(N(t)=n)=F_n(t)-F_{n+1}(t)$, which I think may be useful. But otherwise, I'm really not sure what to do.
It may help to define the iid inter-renewal times $\{X_i\}$, then possibly draw a picture.
Case 1: If $y>n$ then $P[N(t)=n|S_n=y] = [\mbox{fill in blank}]$.
Case 2: If $y\leq n$ then $P[N(t)=n|S_n=y] = P[X_{n+1} > \mbox{fill in blank}]$.