Every time I type “assieme” it is"insieme" and vice versa. Is there a good rule to know when goes one and when goes the other?
They’re pretty much interchangeable in all cases, as described in this page from the Italian encyclopedia Treccani -
ASSIEME O INSIEME? in “La grammatica italiana” (treccani.it)
It discusses some slight differences at the bottom of the page, namely that when used as a noun assieme is rare, and then there’s a mention that in the mathematical sense of “set theory” only insieme is valid “la teoria degli insieme”.
In terms of sentences where we might need to reproduce it (for example in Clozemaster), I expect that it is normally an adverb, and therefore either form would be valid.