There's no rule. You just have to guess and understand from context.
I have two comments. First, the standard definition of "couple" is "two," exactly. It is a synonym for "a pair." That is the strictly correct definition. It is also the most common way it word is used. The use of "couple" to mean "a few" is informal, and much less common. If you see the word "couple," the safe guess is that it means "two."
Second, there are several examples of words that can mean a precise number, but also can be used to mean an indefinite number. You just have to sense the meaning from context.
For example, if I say "I bought a dozen eggs," it means I bought twelve eggs--not eleven or thirteen. But if I say "I have a dozen things I need to do," it just means "I'm very busy."