A loophole in the tax system means former UK taxpayers who may have only lived in the country for three years could qualify for a state pension reaching up to £12,000 annually.