What is the general rule for classifying factor that only shift one supply/demand curve or two supply/demand curve?

What is the general rule in words/mathematical description for a factor that only shifts one supply/demand curve or two supply/demand curves simultaneously?

It is pretty confusing to me, because no single textbook I found had such a rule.