A complex sentence contains an independent clause and a subordinate clause. If you begin the sentence with a subordinating conjunction, then you must put a comma after the subordinate clause. Look at these examples:
If it rains, we will not go to the game.
When I finish my homework, I will watch a movie.
While the pie bakes, I will take a walk.
Each sentence begins with a subordinate clause. We put a comma after the subordinate clause, before writing the independent clause.
If you begin the complex sentence with an independent clause, there is no comma in the sentence.
Look at these sentences that begin with the independent clause:
We will not go to the game if it rains.
I will watch a movie when I finish my homework.
I will take a walk while the pie bakes.
A complex sentence needs a comma if you begin with the subordinate clause. Do not use a comma if you begin with the independent clause.
▶It’s your turn. Look at this complex sentence. Does it need a comma after the first clause? Because I studied I did well on the test. Did you put in a comma? I hope so.