Taxes for which returns were not filed at all or…were filed, but within 2 years of filing a bankruptcy are not dischargeable.
The issue here is not always just the two-year date as that becomes relatively easy to calculate.
It is more often whether or not the return is actually a “return” for purposes of this rule.
If the IRS has filed a substitute return and then the filer submits a correct return later, and more then two years before the bankruptcy filing, the two-year rule may not be met as the return may not qualify as a “return”.