The great majority of people would be better off, if they had more money
and spent it.
While the flour is being made, samples are sent every hour to the
testing department.
If the connection is close, the comma is usually omitted, especially when the dependent clause comes last.
I will be there when the train arrives.
10. When a relative clause furnishes an additional thought, it should be separated from the rest of the sentence by a comma.
Hiram Watts, who has been living in New York for six years, has just
returned to England.
If the relative clause is restrictive, that is, if it restricts or limits the meaning of the antecedent, the comma is unnecessary.
This is the best article that he ever wrote.
11. Commas are used to separate the members of a compound sentence when they are short or closely connected.
Ireland is rich in minerals, yet there is but little mining done there.