Let the height of the box be x. If you draw a net it should be obvious that $\displaystyle V = x(12 - 2x)^2$.