If you have the subordinate clause before the main clause, you write a comma. However, the rules are a bit different for relative pronouns connecting main and subordinate clause.
9.5m questions
12.2m answers