Here's the exact quote:
“Of course it's legal. It's a war. (chuckle) Until the war is over, anything's legal.”
- Rudy Giuliani, September 11, 2016 (when asked about taking Iraq's oil resources during the Iraq war)
A more acturate assessment is that, not only do the victors write the history, they also decide who the war criminals are.
(And when the victor is an autocrat, they don't even bother with the trials.)