Coefficient of $x^{n-2}$ in $(x-1)(x-2)(x-3)\dotsm(x-n)$

Observe that the coefficient of $x^1$ in $$(x-1)(x-2)(x-3)$$ is $$2\cdot3+1\cdot2+1\cdot3$$

or the coefficient of $x^{4-2}$ in $$(x-1)(x-2)(x-3)(x-4)=(x-1)(x-4)(x-2)(x-3)=(x^2-(1+4)x+1\cdot4)(x^2-(2+3)x+2\cdot3)$$

is $$2\cdot3+(1+4)(2+3)+1\cdot4$$

So, the required sum $$=\sum_{1\le r_1<r_2\le n}r_1r_2=\dfrac{(\sum_{r=1}^n r)^2-\sum_{r=1}^n r^2}2$$


Finding the coefficient of $x^{n-2}$ requires picking $2$ terms from the product to multiply the constants. Thus, we get the coefficient to be $$ \begin{align} \sum_{k=2}^n\sum_{j=1}^{k-1}jk &=\sum_{k=2}^n\sum_{j=1}^{k-1}\binom{j}{1}k\\ &=\sum_{k=2}^n\binom{k}{2}k\\ &=\sum_{k=2}^n\binom{k}{2}((k-2)+2)\\ &=\sum_{k=2}^n\left(3\binom{k}{3}+2\binom{k}{2}\right)\\ &=3\binom{n+1}{4}+2\binom{n+1}{3}\\[3pt] &=\frac{(3n+2)(n^3-n)}{24} \end{align} $$


Taking the long way: \begin{align} f_{n}(x) &= (x-1)(x-2)\cdots(x-n) \\ f_{1}(x) &= x-1 \\ f_{2}(x) &= x^2 - 3x + 2 \\ f_{3}(x) &= x^3 - 6x^2 + 11x - 6\\ f_{4}(x) &= x^4 - 10x^3 + 35x^2 = 50x + 24 \\ f_{5}(x) &= x^5 - 15x^4 + 85x^3 - 215x^2 + 274x - 120. \end{align} From here it is determined that $[x^n] \, f_{n}(x) = 1$, $[x^{n-1}] \, f_{n}(x) = -\binom{n+1}{2} = s(n+1,n)$ and $[x^{n-2}] \, f_{n}(x) \in \{ 2, 11, 35, 85, 175, \cdots \}$. This pattern follows the (signed) Stirling numbers of the first kind, $s(n+2,n)$ or $$[x^{n-2}] \, f_{n}(x) = \frac{(n-1) (n) (n+1) (3 n + 2)}{4!} = s(n+1, n-1).$$ One may compare the values obtained to A000914.