Considering some concrete examples may help you understand what he does.
If $n=4$, then
$$\begin{align}1^3-2^3+3^3-4^3&=(1^3+2^3+3^3+4^3)-2(2^3+4^3)\\&=(1^3+2^3+3^3+4^3)-2\cdot 2^3(1^3+\color{red}{2}^3)\\&=\left(\frac{4\cdot 5}{2}\right)^2-2^4\cdot \left(\frac{2\cdot 3}{2}\right)^2.\end{align}$$
Here, note that $\color{red}{2}$ is $n/2$.
If $n=5$, then
$$\begin{align}1^3-2^3+3^3-4^3+5^3&=(1^3+2^3+3^3+4^3+5^3)-2(2^3+4^3)\\&=(1^3+2^3+3^3+4^3+5^3)-2\cdot 2^3(1^3+\color{blue}{2}^3)\\&=\left(\frac{5\cdot 6}{2}\right)^2-2^4\cdot \left(\frac{2\cdot 3}{2}\right)^2.\end{align}$$
Here, note that $\color{blue}{2}$ is $(n-1)/2$.
Considering some concrete examples may help you understand what he does.
If $n=4$, then $$\begin{align}1^3-2^3+3^3-4^3&=(1^3+2^3+3^3+4^3)-2(2^3+4^3)\\&=(1^3+2^3+3^3+4^3)-2\cdot 2^3(1^3+\color{red}{2}^3)\\&=\left(\frac{4\cdot 5}{2}\right)^2-2^4\cdot \left(\frac{2\cdot 3}{2}\right)^2.\end{align}$$ Here, note that $\color{red}{2}$ is $n/2$.
If $n=5$, then $$\begin{align}1^3-2^3+3^3-4^3+5^3&=(1^3+2^3+3^3+4^3+5^3)-2(2^3+4^3)\\&=(1^3+2^3+3^3+4^3+5^3)-2\cdot 2^3(1^3+\color{blue}{2}^3)\\&=\left(\frac{5\cdot 6}{2}\right)^2-2^4\cdot \left(\frac{2\cdot 3}{2}\right)^2.\end{align}$$ Here, note that $\color{blue}{2}$ is $(n-1)/2$.