How can I count solutions to $x_1 + \ldots + x_n = N$? I am interested in how many non-negative integer solutions there are to:
$$x_1 + \ldots + x_N = B$$
where at least $K$ of the variables $x_1, \ldots , x_N \geq C$
For example when:
$B = 5, N = 3, K = 2, C = 2$
I want to count the solutions to:
$$x_1 + x_2 + x_3 = 5$$
where at least $2$ of the variables are $\geq 2$.
I found the total number of candidate solutions using the $\binom{B+N-1}{B} = 21$
However, only $9$ of them have two variables $\geq 2$.
\begin{align*}
    2+0+3& =5\\
    2+1+2& =5\\
    3+0+2& =5\\
    1+2+2& =5\\
    3+2+0& =5\\
    0+2+3& =5\\
    0+3+2& =5\\
    2+3+0& =5\\
    2+2+1& =5
\end{align*}
I feel there is a connection to the Associated Stirling numbers of the second kind. But I can't place it :(
EDIT:
Here is my code for enumerating them all to count the number of ways of select B elements from a set of N (uniformly with replacement), such that you have at least C copies of K elements - also shows the output for this question I'm asking here as it's the core piece. Obviously can't be run for very large values of the parameters - that's why I'm here :) Code is here
Here is another example for B = 6, N = 3, C = 2 and K = 2 there are 16 solutions:
\begin{align*}
0+2+4& = 6\\
0+3+3& = 6\\
0+4+2& = 6\\
1+2+3& = 6\\
1+3+2& = 6\\
2+0+4& = 6\\
2+1+3& = 6\\
2+2+2& = 6\\
2+3+1& = 6\\
2+4+0& = 6\\
3+0+3& = 6\\
3+1+2& = 6\\
3+2+1& = 6\\
3+3+0& = 6\\
4+0+2& = 6\\
4+2+0& = 6\\
\end{align*}
There are a number of different and correct solutions below. I don't know which to accept. 

Let $A_i$ be the set of solutions in nonnegative integers to $x_1+\cdots+x_n=B$ with $x_i\ge C$, for $1\le i\le n$, 
and let $T_l=\sum\big|A_{i_1}\cap\cdots\cap A_{i_l}\big|$, where the sum is taken over all $l$-subsets of $\{1,\cdots,n\}$, for $1\le l\le n$.
Using Inclusion-Exclusion, the number of elements in at least k of $A_1,\cdots,A_n$ is given by
$\displaystyle\sum_{i=k}^n(-1)^{i-k}\binom{i-1}{k-1}T_i=\color{blue}{\sum_{i=k}^n(-1)^{i-k}\binom{i-1}{k-1}\binom{n}{i}\binom{B-Ci+n-1}{n-1}}$ 
since $T_i$ is the sum of $\binom{n}{i}$ terms, each of which has the value $\binom{B-Ci+n-1}{n-1}$.

See also this answer https://math.stackexchange.com/a/362516
for a related version of Inclusion-Exclusion.

Here are a few examples, which have been verified by considering cases:
$\textbf{1)}$ $B=6, n=3, C=2, k=2$: 
$\displaystyle\sum_{i=2}^3(-1)^{i-2}\binom{i-1}{1}\binom{3}{i}\binom{8-2i}{2}=\binom{1}{1}\binom{3}{2}\binom{4}{2}-\binom{2}{1}\binom{3}{3}\binom{2}{2}=18-2=\color{blue}{16}$
$\textbf{2)}$ $B=12, n=5, C=4, k=2$:
$\displaystyle\sum_{i=2}^5(-1)^{i-2}\binom{i-1}{1}\binom{5}{i}\binom{16-4i}{4}=\binom{1}{1}\binom{5}{2}\binom{8}{4}-\binom{2}{1}\binom{5}{3}\binom{4}{4}=700-20=\color{blue}{680}$
$\textbf{3)}$ $B=18, n=6, C=3, k=4$:
$\displaystyle\sum_{i=4}^6(-1)^{i-4}\binom{i-1}{3}\binom{6}{i}\binom{23-3i}{5}=\binom{3}{3}\binom{6}{4}\binom{11}{5}-\binom{4}{3}\binom{6}{5}\binom{8}{5}+\binom{5}{3}\binom{6}{6}\binom{5}{5}=\color{blue}{5,596}$
