Punctuating with subordinate conjunctions
When the subordinating conjunction begins the sentence, the subordinating clause is separated from the independent clause with a comma.
No comma is used when the independent clause/main clause follow the subordinating clause.

