Here's how it works:
* Verb: It's the present participle of the verb "sleep" (e.g., "The baby is sleeping").
* Adjective: It describes something that is in the state of sleep (e.g., "a sleeping dog").
To determine which part of speech it is, you need to look at the context of the sentence.