Replace multiple strings with multiple other strings

I'm trying to replace multiple words in a string with multiple other words. The string is "I have a cat, a dog, and a goat." However, this does not produce "I have a dog, a goat, and a cat", but i...