Use a comma before but when it connects two independent clauses (parts of a sentence that could stand alone). For example: She likes pizza, but she doesn’t like pasta. It was snowing, but they decided to go outside. I wanted to go to the movies, but I didn’t finish my homework. More @Wikipedia
Hover over any link to get a description of the article. Please note that search keywords are sometimes hidden within the full article and don't appear in the description or title.