There are special National Insurance rules for people who travel outside the UK and for people who come to the UK from abroad.