You can discharge back taxes in bankruptcy if the following conditions apply:
The tax debt is at least 3-years-old.
The taxes were assessed at least 240 days before filing for bankruptcy.
You filed a tax return (the IRS didn’t file one for you) and did not commit tax fraud or willfully commit tax evasion.