Order matters for permutations. Order doesn't matter for combinations. That single distinction is the whole game.
Google this topic and you will get a hundred answers, half of them wrong. Here is the version that holds up. Order matters for permutations. Order doesn't matter for combinations. That single distinction is the whole game.
n! = n × (n−1) × ... × 1. 5! = 120. 0! = 1 by convention.
Ways to arrange r items from n where order matters. n!/(n−r)!
Ways to choose r items from n where order doesn't matter. n!/((n−r)!r!)
Why is 0! = 1? Convention that makes the combination formula work when r = n.
What about repeats? Different formulas — multinomial coefficients handle repeated items.
Bookmark the calculator linked above — you will need it more often than you think.