First off, that last step isn’t right, so I’m going to start from the beginning.
$$\begin{align*}
\sum_{i=1}^n\sum_{j=0}^{n-i}\left(3j^2-2\right)&=\sum_{i=1}^n\left(\sum_{j=0}^{n-i}3j^2-\sum_{j=0}^{n-i}2\right)\\\\
&=\sum_{i=1}^n\sum_{j=0}^{n-i}3j^2-\sum_{k=1}^n\sum_{j=0}^{n-i}2\;.
\end{align*}$$
Now let’s deal separately with these summations. There are $n-i+1$ terms in the inner summation, so
$$\begin{align*}
\sum_{i=1}^n\sum_{j=0}^{n-i}2&=\sum_{i=1}^n2(n-i+1)\\\\
&=2\left(\sum_{i=1}^n(n+1)-\sum_{i=1}^ni\right)\\
&=2\left(n(n+1)-\frac{n(n+1)}2\right)\\\\
&=n(n+1)\;.
\end{align*}$$
The first one is a little messier:
$$\begin{align*}
\sum_{i=1}^n\sum_{j=0}^{n-i}3j^2&=\sum_{i=1}^n\frac{(n-i)(n-i+1)\big(2(n-i)+1\big)}2\\\\
&=\frac12\sum_{i=1}^n\Big((n-i)(n-i+1)\big(2(n-i)+1\big)\Big)\\\\
&\overset{*}=\frac12\sum_{k=0}^{n-1}k(k+1)(2k+1)\\\\
&=\frac12\sum_{k=0}^{n-1}\left(2k^3+3k^2+k\right)\\\\
&=\sum_{k=0}^{n-1}k^3+\frac32\sum_{k=0}^{n-1}k^2+\frac12\sum_{k=0}^{n-1}k\\\\
&=\left(\frac{(n-1)n}2\right)^2+\frac{(n-1)n\big(2(n-1)+1\big)}4+\frac{(n-1)n}4\;.
\end{align*}$$
The step marked with an asterisk is accomplished by letting $k=n-i$: as $i$ runs from $1$ through $n$, $n-i$ runs from $n-1$ down through $0$. Now just simplify this last result, combine with the first one, and simplify again to get the final result.