Sir Keir Starmer has left the House of Commons for the final time as prime minister after just over two years in office.