Exchange control of two target permanents that share a card type. (Artifact, creature, enchantment, land, and planeswalker are card types.)
Either target can have card types the other does not, as long as they share at least one card type. For example, you could target a creature and an artifact creature.
Gaining control of an Aura or Equipment doesn’t cause it to move, though gaining control of an Equipment will allow you to activate its equip ability later to attach it to a creature you control.
If another spell or ability allows you to change the targets of Shifting Loyalties (or perhaps copy it and choose new targets for the copy), you can change the targets only such that the final set of targets is still legal. For example, if Shifting Loyalties targets a creature you control and a creature an opponent controls, you couldn’t change just the second target to a noncreature permanent controlled by that player. You could, however, change just the second target to a creature controlled by a different opponent. The two new targets can share a different card type than the two original targets did.
If one of the target permanents is an illegal target when Shifting Loyalties resolves, the exchange won’t happen. If both permanents are illegal targets (perhaps because they no longer share a card type), Shifting Loyalties won’t resolve.
If the same player controls both permanents when Shifting Loyalties resolves, nothing happens.
You don’t have to control either target permanent.