The word ‘while’ creates a subordinating conjunction when it begins a sentence. The key is that it instantly makes the clause dependent whether it is independent or dependent, so you will have to follow it with an independent clause. When you attach a subordinate clause in front of a main clause, use a comma, like this:
Subordinate Clause + , + Main Clause.
While Mary slept on the sofa in front of the television, Rover the family dog, gnawed on the leg of the coffee table.
While the snow just kept coming down, it was not accumulating as quickly as you would think.
While I did my homework, my father was washing the car.
While my parents drank coffee, my brother was watching TV.
‘While’ is the subordinate conjunction that introduces the subordinate clause, and because it appears at the beginning of the complete sentence, it is separated from the main clause with a comma.