Let, \({A_i}\) be the event that box i have at least three balls. Then,
\(\begin{aligned}{}\Pr \left( {{A_i}} \right) = \sum\limits_{j = 3}^5 {\Pr \left( {Box\,\,i\,\,has\,\,exactly\,\,j\,\,balls} \right)} \\ = \frac{{\left( {\begin{aligned}{{}{}}5\\3\end{aligned}} \right){{\left( {n - 1} \right)}^2}}}{{{n^5}}} + \frac{{\left( {\begin{aligned}{{}{}}5\\4\end{aligned}} \right)\left( {n - 1} \right)}}{{{n^5}}} + \frac{1}{{{n^5}}}\\ = \frac{{10{{\left( {n - 1} \right)}^2}}}{{{n^5}}} + \frac{{5\left( {n - 1} \right)}}{{{n^5}}} + \frac{1}{{{n^5}}}\\ = \frac{{10{n^2} - 20n + 10 + 5n - 5 + 1}}{{{n^5}}}\\ = \frac{{10{n^2} - 15n + 6}}{{{n^5}}}\\ = p,\,\,say\end{aligned}\)
Since there are only five balls, two boxes can't have at least three balls simultaneously. Therefore, the events\({A_i}\)are disjoint, and the probability that at least one of the events,\({A_i}\)occurs is np.
Hence, the probability that no box contains more than two balls is:
\(\begin{aligned}{}1 - np = 1 - n \times \frac{{10{n^2} - 15n + 6}}{{{n^5}}}\\ = 1 - \frac{{10{n^2} - 15n + 6}}{{{n^4}}}\\ = \frac{{{n^4} - 10{n^2} + 15n - 6}}{{{n^4}}}\end{aligned}\).
That is \(\frac{{{n^4} - 10{n^2} + 15n - 6}}{{{n^4}}}\)