Since 1983, Treasury regulations have provided guidelines for determining whether a foreign tax qualifies.
However, the IRS has adopted a hard line (and very legalistic) stance in applying these guidelines.