How to properly punctuate dialogue

Dialogue is vital in most fiction as it conveys characters’ motivations and provides information the reader must know to move along the story. Getting the punctuation of dialogue right then is of the utmost importance. After all, a misplaced or forgotten quotation mark can confuse readers about what is said and who said it.

When punctuating dialogue, follow these basic rules:

Place a quotation mark before what is spoken.
Hello, Johnson residence. 

Place quotation mark at end of what is spoken.
“Hello, Johnson residence.”

If telling who is speaking (aka attribution) after a spoken line of dialogue, use a comma before the closing quotation mark.
“Hello, Johnson residence,” Mary said.

Then lowercase the first word after the closing quotation mark (unless it’s a proper noun).
“Hello, Johnson residence,” said Mary.

If a question mark or an exclamation mark appears at the end of what’s spoken, there’s no need for the comma.
“Hello, Johnson residence; who is this please?” said Mary.

If the character continues to speak, keep the dialogue in the same paragraph and use a new quotation mark.
“Hello, Johnson residence,” said Mary. “How many I help you?

…And close it up with a quotation mark.
“Hello, Johnson residence,” said Mary. “How many I help you?”