Use of 'bod' for 'that'

S’mae. This is about ‘bod’ used for ,‘that’ . Dywedodd hi ei bod yn mynd I,r siop neu dywedasan nhw fy mod yn anghywir. I have also come across the mutation ‘fod’ in the same use. Why the mutation, any rules ??? Diolch, Nigel

Yes, there are rules for the mutation of bod when it means ‘that’ and it’s the pronoun that causes the mutation. Just to complicate things though, sometimes the first (mutation causing) pronoun is left off but the mutation stays, and sometimes the second pronoun isn’t used if the first is (but there’s always one or the other - they don’t both disappear at the same time).
The fully grammatical set is:
fy mod i
dy fod ti
ei fod o/e
ei bod hi
eich bod chi
ein bod ni
eu bod nhw

However, the mutations aren’t always used in colloquial speech, so you’ll very likely come across:
bo’ fi
bo’ ti
bod o/e
bod hi
bo’ chi
bo’ ni
bo’ nhw