Here's a (probably non-exhaustive) list of 65 different variants. The article in Swedish, but it should be possible to understand the list:
https://sverigesradio.se/sida/artikel.aspx?programid=411&art...
Edit: I don't know of any rules for when to use which spelling. When I was a kid, I just learned how the different words were spelled individually, even though the sound is the same. Same thing when I'm teaching my kids: "Sju (seven) is spelled like this, schack (chess) is spelled like this, charmig (charming) is spelled like this", and so on.