When $A,B$ commute you can apply the binomial theorem, as you did, which gives that $(A+B)^2=A^2+2AB+B^2$. Since you have the hypothesis $A^2=0$ and $B^2=0$, this means that $(A+B)^2=2AB$, and the question is whether this is forced to be $0$ under the given hypotheses.
If you have played a bit with the possibilities of (commuting) nilpotent matrices, you may know that they can often be modelled by partial maps from a finite set to itself, each element of the set representing a basis vector, and the map describing basis vectors being mapped to other basis vectors, with the elements where the map is undefined corresponding to basis vectors mapped to$~0$. Here I'll take a finite set$~S$ of points in$~\Bbb Z^2$, the maps being a shift in the horizontal and vertical direction (which ensures commutation) whenever that lands inside$~S$. The conditions $A^2=0$ and $B^2=0$ mean the $S$ can have no more than $2$ successive points horizontally and vertically, and $AB$ is a shift by $(1,1)$. It seems clear that the hypotheses do not imply that such a shift always takes a point of $S$ outside the set$~S$. The simplest counterexample is with $S$ being the four corners of a unit square. This give rise to matrices
$$
A=\pmatrix{0&1&0&0\\0&0&0&0\\0&0&0&1\\0&0&0&0\\}
\quad\hbox{and}\quad
B=\pmatrix{0&0&1&0\\0&0&0&1\\0&0&0&0\\0&0&0&0\\}
$$
which indeed verify the hypotheses, but fail the conclusion: $(A+B)^2=2AB\neq0$.