Tax avoidance is the grey area between tax compliance and tax evasion. When tax avoiding a taxpayer to ensure that one of these happens:
a. less tax is paid than might be required by a reasonable interpretation of the law of a country, or
b. income is declared in a country which does not appear to be that in which it was really earned, or
c. tax is paid somewhat later than the income to which it relates was earned.
The difference between tax avoidance and tax compliance is that tax compliance is seeking to pay the right amount of tax (but no more) in the right place at the right time where right means that the economic substance of the transactions undertaken coincides with the place and form in which they are reported for taxation purposes whilst tax avoidance seeks to reduce tax paid by working between the letters of the law.
Both tax avoidance and tax compliance can claim to be legal, but only tax compliance can justify that claim with certainty. Tax avoidance relies on the existence of doubt for its validity.