When should "doctor" be capitalized?
When you can add a surname to the sentence, it should be capitalised;
Doctor Smith will see you now
When it is a job description, (usually prefixed with 'a' or 'the') leave it out;
The doctor will see you now.
Think of 'Doctor' as becoming part of someone's actual name, and so when it's used to address a specific person, treat it like a proper noun.
It should always be capitalized when abbreviated to Dr., as in Dr. Trump.
It must never be capitalized if it's spelled out and not followed by a surname or Christian name. As in
"The doctor will see you now even though he doesn't really want to."