Mucus that is any colour other than clear is a sign of an infection. Of course extreme circumstances can also apply. For example I worked in a factory for a while and my mucus (or snot) was black every night, that’s not from an infection it’s just plain old dirt.
When you have a runny nose it is usually due to a cold or some kind of virus or infection. Often the symptoms of these infections are a runny nose. Usually if you just have a virus your nose will run with clear mucus because that is just a symptom. Often enough however you may have a sinus infection in which case the infection is right in your nose rather than in your blood stream. This infection is trying to spread itself as hard as a virus would but it is more visible in that it is yellow and gross. Well I guess all snot is gross.
If you’re not sick you still have some mucus build up, often the mucus is so minimal that it just dries up in your nose. We affectionately refer to this mucus as a booger. Boogers can be green or yellow in tinge but that’s just because they are dried up bits of mucus that have been collecting dirt and dust from the air as you breathe.
This site gives some more information on yellow-greenish mucus.
http://www.sinuswars.com/mucus-yellow.asp