We need to state clearly the terms of the problem to avoid misunderstandings.
So, it looks that the interpretation of the problem should be:
- we have $r$ undistinguishable balls and $n$ distinguishable (i.e. labeled) bins;
- the bins have unlimited capacity , so each can be filled with $0$ to $n$ balls;
- the balls are laid (not launched) into the bins; that means that we are parting the balls
into the bins in a Stars&Bars or better weak Compositions
of $r$ into $n$ parts; the total number of ways of doing that is $$T(r,n)=\binom{r+n-1}{r}$$
- it is asked to find the number of compositions in which there are exactly $m$ boxes filled with exactly $k$ balls, while the remaining boxes
might be empty or filled with a number of balls which is lower or greater than $k$.
If this is the correct understanding, then consider the following scheme
which is much of help to "keep under sight" what is the path to follow.
We take one of the possible occupancy histogram and re-arrange it into the three blocks as shown,
just translating each bar to the pertinent block without altering the sequence within the block.
It is important to note that each histogram on the right will correspond to
a number of histograms on the left which equals the combinations of a collection
of three different items, i.e.
$$
H = \left( \matrix{ n \cr b,\;m,\;n - m - b \cr} \right)
= \left( \matrix{ n \cr m \cr} \right)\left( \matrix{ n - m \cr b \cr} \right)
$$
The shuffling within each block will be accounted in the computation of the relevant number of ways. These are
a) for the block with exactly $k$ balls in each bin there is of course only $1$ way
b) for the block with max $k-1$ balls the number of different ways to compose it is given by
$$
N_b (j,k - 1,b) = \sum\limits_{\left( {0\, \le } \right)\,\,l\,\,\left( { \le \,{j \over k}\, \le \,b} \right)}
{\left( { - 1} \right)^l \binom{ b }{l}
\binom{ j + b - 1 - l\,k }{ j - l\,k } }
$$
as explained in this related post
c) for the block with more than $k$ balls, only $r - j - mk -(n-m-b)(k+1)= r-j+m-(n-b)(k+1)$ are free to be differently allocated, so that
corresponds to the weak compositions
$$
N_c = \binom{
r - j - 1 - \left( {n - b} \right)k }{
r - j + m - \left( {n - b} \right)\left( {k + 1} \right) }
$$
Putting all together we get
$$
\eqalign{
& N = \sum\limits_{j,b} {H \cdot 1 \cdot N_b \cdot N_c } = \cr
& = \left( \matrix{ n \cr m \cr} \right)\sum\limits_{j,b}
{\left( \matrix{ n - m \cr b \cr} \right)\left( \matrix{ r - j - 1 - \left( {n - b} \right)k \cr
r - j + m - \left( {n - b} \right)\left( {k + 1} \right) \cr} \right)
\sum\limits_l {\left( { - 1} \right)^l \left( \matrix{ b \hfill \cr l \hfill \cr} \right)
\left( \matrix{ j + b - 1 - l\,k \cr j - l\,k \cr} \right)} } = \cr
& = \left( \matrix{ n \cr m \cr} \right)\sum\limits_{l,b}
{\left( \matrix{ n - m \cr b \cr} \right)\left( { - 1} \right)^l \left( \matrix{ b \cr l \cr} \right)
\sum\limits_j {\left( \matrix{ r - j - 1 - \left( {n - b} \right)k \cr r - j + m - \left( {n - b} \right)\left( {k + 1} \right) \cr} \right)}
\left( \matrix{ j + b - 1 - l\,k \cr j - l\,k \cr} \right)} = \cr
& = \left( \matrix{ n \cr m \cr} \right)\sum\limits_{l,b} {\left( { - 1} \right)^l \left( \matrix{ n - m \cr b \cr} \right)
\left( \matrix{ b \cr l \cr} \right)\left( \matrix{ r\; + b - 1 - \left( {n - b + l} \right)k \cr
r + b + m - n - \left( {n - b + l} \right)k \cr} \right)} \cr}
$$
where to the inner sum we have applied the "double convolution" identity.
Continuing in the simplification, putting
$$
j = n - b + l\quad \Rightarrow \quad b = n - j + l
$$
we can rewrite the sums as
$$
\eqalign{
& \sum\limits_{l,\,j} {\left( { - 1} \right)^l \left( \matrix{ n - m \cr n - j + l \cr} \right)
\left( \matrix{ n - j + l \cr l \cr} \right)\left( \matrix{ r\; + n - j + l - 1 - jk \cr r + n - j + l + m - n - jk \cr} \right)} = \cr
& = \sum\limits_{l,\,j} {\left( { - 1} \right)^l \left( \matrix{ n - m \cr l \cr} \right)
\left( \matrix{ n - m - l \cr n - j \cr} \right)\left( \matrix{ r\; + n - j + l - 1 - jk \cr r + n - j + l + m - n - jk \cr} \right)} = \cr
& = \sum\limits_{l,\,j} {\left( { - 1} \right)^l \left( \matrix{ n - m \cr n - m - l \cr} \right)
\left( \matrix{ n - m - l \cr n - j \cr} \right)\left( \matrix{ r\; + n - j + l - 1 - jk \cr r + m - j + l - jk \cr} \right)} = \cr
& = \sum\limits_{l,\,j} {\left( { - 1} \right)^l \left( \matrix{ n - m \cr n - j \cr} \right)
\left( \matrix{ - m + j \cr - m - l + j \cr} \right)\left( \matrix{ r\; + n - j + l - 1 - jk \cr r + m - j + l - jk \cr} \right)} = \cr
& = \sum\limits_{l,\,j} {\left( { - 1} \right)^{m - j} \left( \matrix{ n - m \cr n - j \cr} \right)
\left( \matrix{ - l - 1 \cr - m - l + j \cr} \right)\left( \matrix{ r\; + n - j + l - 1 - jk \cr r + m - j + l - jk \cr} \right)} = \cr
& = \sum\limits_j {\left( { - 1} \right)^{m - j}
\left( \matrix{ n - m \cr n - j \cr} \right)\left( \matrix{ r\; + n - j - 1 - jk \cr r - jk \cr} \right)} \cr}
$$
by applying the "trinomial revision" and "double convolution" identities.
Finally we can conclude that
$$ \bbox[lightyellow] {
N = \left( \matrix{ n \cr m \cr} \right)\sum\limits_j
{\left( { - 1} \right)^{m - j} \binom{ n - m }{ n - j }
\binom{ r\; + n - j - 1 - jk }{ r - jk } }
}$$
which is the same formula as the one already given by Joriky.