There are quite some materials online with some fairly complicated results. For example.
https://www.mathpages.com/home/kmath337/kmath337.htm
And I know the proper way to handle this is inclusion-exclusion principle.
But what's wrong with below simple approach:
say I want $m$ balls into $n$ bins with capacity $r$.
So we want $x_1 + x_2 + ... + x_n = m$ where $0 \leq x_i \leq r, x_i \in Z^{+} $
or $-x_1 - x_2 + ... - x_n = -m$
we want $x_i \leq r$, so $-x_i +r \geq 0$. Let $y_i = -x_i + r$, then above is
$y_1 + y_2 + ... + y_n = rn - m$, $y_i \geq 0$
Then now it's a classical problem of putting $rn-m$ balls in $n$ bins
what's worng with my approach?
As Saulspatz pointed out you have $$y_1 + y_2 + ... + y_n = rn - m$$ with $ y_i \geq 0.$ That's good. You are correct so far, and you have not done anything bad so far. But to apply the standard distribution technique you also need that $ y_i \leq rn - m.$ Unfortunately, you don't have that criterion in your conditions. I hope it helps.