Coordinating conjunctions can join two complete sentences (independent clauses) to create a compound sentence. In such sentences, the comma precedes a short conjunction, such as "but." For instance, many low-calorie soups taste good, but they are often too salty. With correlative or paired conjunctions (e.g., not only . . . but also), the same rule applies to compound sentences: Not only did I savor the salty soup, but I also devoured the briny shrimp.
Without two complete sentences, a comma before a coordinating conjunction may become unnecessary. Note the lack of commas in the following sentence: Craig and I savored the salty soup and briny shrimp. Despite the compound subjects (Craig and I) and compound objects (soup and shrimp), only one sentence exists, not two. Similarly, in this single sentence -- Craig savored the onion soup and devoured the shrimp -- no comma separates the compound verbs (savored and devoured).
Capital Community College, however, notes the use of the comma for contrast within a single sentence. A coordinating conjunction expressing contrast (e.g., but, yet) requires a comma. Note the comma before "but" in this sentence: Craig enjoyed the onion soup, but not the briny shrimp.
Use a comma before subordinating conjunctions showing contrast (e.g., although, even though or while) when the subordinate clause appears at the end of the sentence. In this sentence -- "I remained at my current job, although I won the lottery" -- the comma precedes "although."
To join only two items, omit the comma before the conjunction: I bought bottled water and a flashlight for an emergency. Once you add additional items, comma use varies, depending on the writing style. Many U.S. reference manuals recommend the extra comma before the "and" or "or": "I bought bottled water, a flashlight, and soup." Capital Community College, however, recognizes the British option to omit this serial or Oxford comma. In addition, the styleguide for newspaper journalists in the U.S. -- the Associated Press Stylebook -- does not use the comma before the "and" in a series of three or more items.