Internal Revenue Code section 217 allows all taxpayers to deduct their moving expenses, but only if they are moving for a new job. As described previously, there are additional moving tax breaks for American moving abroad.
Once the taxpayer has moved abroad, Internal Revenue Code section 217(i) provides even more special tax breaks. The taxpayer can deduct his moving expenses for moving back to the United States for retirement, notwithstanding the normal requirement that a tax-deductible move has to be for a new job.
The retirement has to be a "bona fide retirement" under which the taxpayer intends to permanently stop working, but it is okay if the taxpayer ultimately resumes gainful full-time
Furthermore, if someone dies while working abroad, his spouse and dependents can deduct their expenses for moving back to the United States, as long as they move within 6 months of the death. This rule does not apply if someone dies in the United States and their spouse and dependents move afterwards.
In contrast, someone who moves within the United States because of retirement or death of a family member is not allowed to deduct any moving expenses, unless a new job happens to be at the new location.