Distribution of different objects into different boxes We want to put n different objects into n different boxes. In how many ways can we do this if we want that exactly two boxes remain empty?

*
*Select the $2$ of $n$ boxes you wish to remain empty.  $\binom{n}{2}$ arrangements.

*Put the remaining $n$ objects, at least $1$ object into each of the $n-2$ remaining boxes and in either:
*
*1 box will have $3$ objects. Giving $\,^{n-2}C_1 \,^{n}P_{3}$ permutations.
*2 boxes will have 2 objects, giving $\,^{n-2}C_2 \,^{n}P_{2,2}$ permutations

$$\,^{n}C_{2}\cdot \left(\,^{n-2}C_1 \,^{n}P_{3}+\,^{n-2}C_2 \,^{n}P_{2,2}\right) \\ = \frac{n!}{2(n-2)!}\left(\frac{(n-2)!}{1!(n-3)!}\frac{n!}{6}+\frac{(n-2)!}{2!(n-4)!}\frac{n!}{4}\right) \\ = \frac{n!^2(4n-13)}{48(n-4)!}
$$
[edit: distinct objects]
