Almost all titles (or more accurately, offices) are lowercase unless the full title and person is cited: prime minister and president in general writing, but the Prime Minister of Australia, Malcolm Turnbull, met with President Donald Trump to discuss new directions in Lego. (Note that the phrase ‘Prime Minister Malcolm Turnbull’ is a newspaper invention and there is no such office, officially speaking.)

Typically ranks are in lowercase, except when cited in direct speech: Said one sergeant to the other: ‘Good evening, Sergeant.’