Using a comma before which is different from one phrase to another, like: in nonrestrictive phrase we don't use a comma before which but when it's a part of prepositional phrase like "in which" we use a comma before which and also we don't use a comma when we introduces an indirect questions.