This part of GOV.UK is being rebuilt – find out what beta means

HMRC internal manual

National Insurance Manual

special cases: international - people going to or coming from abroad: row: special rules

There are special rules for certain persons or categories of persons.

Mariners NIM29000 

Aircrew NIM27000 

HM Forces NIM32000 

Diplomatic Agents - are exempt from any social security provisions in receiving state under Diplomatic Privileges Act 1964