I’m comfortable with saying defeating Al Qaeda was defending our freedom. Because one of their end goals, even if not achievable, was to bring their version of Islam to America, which would entail a loss of freedom. I’m also comfortable with the attacks on the current version of ISIL to be “defending our freedom” because they want to kill Westerners and try to do so. Defending your life may as well be defending your freedom.
On the other hand, Saddam Hussein, and ISIL before they brought terrorism to the West, had no goals of actually attacking America. Same thing in Afghanistan once we had flushed out Al Qaeda.
If the only thing that counts is an existential threat to the core of already existing American freedoms, then the answer is never. The British were never going to conquer America in the War of 1812 and did not set out to do so. The South in the Civil War was never going to take away, by their attacks, any freedoms in the North that already existed. The Revolutionary War was a tax revolt, whipped into a revolution by the equivalent of right wing nuts who thought that any taxation was tyranny. So I guess it was defending our right to…no taxes? Yay? (It did turn into a defense of freedom due to British atrocities and the curtailing of local sovereignty.)