First, use an anvil to change the name of the name tag. The changed name is the name that can be used to name the creature.
Then, hold the name tag and point it at the creature. A button will appear and you can click it to name it.
Finally, Grumm can make most creatures stand upside down, and jeb_ can turn ordinary sheep into rainbow sheep.