The Basic 7: Rules for Comma Usage
Rule 1: Put a comma before a coordinating conjunction (and, but, or, nor, and sometimes for and yet) when it connects two (or more) independent clauses. Here are some examples:
John looked up an old friend on the Internet, and then he e-mailed her.
Mary wanted to go to the mall, but her father reminded her that she had promised to wash the car.
I will not vote for that candidate, for I am a died-in-the-wool Democrat.
You had better pay your car note, or the finance company will repossess your car.
You had better pay your car note, or the finance company will respossess your car, and you will have no way of getting to work.
Rule 2: Put a comma between three or more items in a series. Think about dates and addresses as being "items in a series." Here are some examples.
We rang the doorbell, banged on the door, and shouted.
On January 5, 2002, we will begin a new semester.
We will move to 165 North Avenue, Chicago, Illinois, in October.
Rule 3: Put a comma after introductory adverbial clauses and verb phrases (participials and infinitives). Here are some examples.
To get a decent mortgage rate, Wayne went with an Internet company.
Grinning like the Cheshire cat, Mary accepted her highschool diploma.
When Mary received her highschool diploma, she was grinning like a Cheshire cat.
Rule 4: Put a comma around nouns of direct address. Here are some examples.
I hope you're happy, John.
I know, Mary, that you will do a good job.
Mary, it's your turn to set the table.
Rule 5: Put a comma around expressions that interrupt the flow of the sentence. Here are some examples.
I will, however, take your suggestion under advisement.
In the future, of course, you'll want to make sure you get to class on time.
It is to your advantage, I think, to get to class on time.
Rule 6: Put a comma around nonrestrictive phrases and clauses. Here are some examples.
The Volkswagen, which we bought last summer, has been a great little car.
The Magic Flute, an opera composed by Mozart in 1791, is still performed today.
Madge Diehard, whom I voted for in the last election, was soundly defeated.
Rule 7: Use commas to prevent misreading. Here are some examples.
Before she had believed that everything would work out well; now she was not so sure.
Before, she had believed that everything would work out well; now she was not so sure.

To John Harrison had been an idol.
To John, Harrison had been an idol.

The morning after the policemen came to the door.
The morning after, the policemen came to the door.