Capital (upper case)
letters should be used at the beginning of the names of specific people as
well as the titles of people when used with their names.
In the first example
above in the animation, President Barack Obama, notice that his title of
President is capitalized as well as Barack Obama.
President Barack Obama
Such words as the, a, an, of, etc.. which are smaller
words that are not descriptive parts of the title are left in lower case.
In the second example,
Speaker of the House Nancy Pelosi, Speaker and House are capitalized as major words in her title and Nancy and Pelosi are capitalized as her name.
Speaker of the House
Nancy Pelosi
Chief Justice John Roberts has the two words of his title and the two words of his name capitalized.