A comma does three things:
Besides discussing these three rules, this page also contains a discussion of sentence fragments, comma splices, and run-ons
Coordinate Conjunctions: and, so, but, for, or
What happens if the list items have commas in them?
Notice that when there are commas within the list items, you place a semicolon between the list items.
1b. A comma separates a main clause from its free modifiers.
1c. With a
coordinate conjunction, a comma separates two main clauses.
A sentence fragment is a group of words that is not
a main clause, but it has been punctuated as though it
were:
A comma splice consists of two main clauses which
are not punctuated as such:
What happens when one of the main clauses has internal
punctuation?
What are sentence fragments,
comma splices, and
run-on sentences?
These three punctuation errors, usually considered major
errors in student writing, result from the failure to
recognize a main clause.
When I have finished my homework.
The above group of words has a capital and a period, so
it is pretending to be a complete sentence, but it is
only a subordinate clause. In dialogue, this fragment
might be punctuated as a sentence if someone is portrayed
as responding to a question like, "When can we go for a walk?"
In other cases, it should be attached to a main clause and
set off with a comma.
They drove to Ottawa, they looked for a parking place.
This apparent single sentence contains two main clauses
attached to each other with nothing more than a comma. A
comma just doesn't have enough power to "splice" or "join"
two main clauses by itself. You need a coordinate
conjunction, or you might turn one of the main clauses
into a free modifier, like this:
After driving to Ottawa, they looked for a parking
place.
A run-on sentence is a comma splice without the
comma. Fix it the same way you would fix a comma splice.