Conjunctions often hook two sentences or more together. Those sentences can be classed as dependent or independent.
When two or more sentences are combined with a conjunction or multiple conjunctions into one sentence, the parts are called clauses.
All those clauses can be independent.
In that case, a comma is required before each conjunction. Independent means the clause is NOT about the same thing as another clause and DOES NOT redefine another clause, and DOES NOT expanded the readers understanding of another clause.
If one clause is independent, another clause might be about the same thing. It's called dependent then, because it requires the meaning of another independent clause for its complete sense. It depends on its linked independent clause.
If the independent clause comes first in the sentence, a comma might not be required after it. Ex: Sarah might agree to go on a date if John bought the movie tickets (dependent because it expands the reader's understanding of Sarah agreeing). A comma might be included in the following case for clarity too. Ex: Sarah might agree to go on a date, if John bought the movie tickets and asked her and shined his shoes.
If the dependent clause comes first, a comma is always required. Ex: If John bought movie tickets, Sarah might agree to go on a date.
Some conjunction by their own meaning suggest a comma is not necessary when placed second. If, whether, because, although, since, when, while, and unless only require a comma when placed first.
If for, and, or, yet, and so and even not usually require a comma unless the subject of first clause is repeated in the second.. Ex: 'You're writing, are you not?' or 'You're writing, aren't you?' both use 'not' toward the end as the conjunction, because it's a question. Still the comma is required.
With 'where' and some other clause connectors, if you can't remove the clause you don't need the comma.
Since these issues are the subject of endless arguments even among grammarians, the main rule is to use a comma where it aids in the clarity of what's being said.