The insight is simple: convert the words to a set, and the set's length is your answer.
A set automatically removes duplicates. You don't need to track what you've seen. You don't need any loops to check for repeats. Just convert and count.
words = sentence.split() # List of words
unique = set(words) # Duplicates gone
count = len(unique) # Your answer
Or in one line: len(set(sentence.split())). This is the power of choosing the right data structure.