Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
In the first sentence, he is wasting time, and that is what you don't like: you don't like him [when he is] wasting time. Your second sentence is grammatical but not idiomatic. It could be said when "he is malnourished and wasting away, and I don't like those times when he is losing weight." But that isn't your intention, I am sure, to use it like "partying time" or "waiting time".
Note that in some contexts, the two are not exchangeable because they mean different things. For example: I don't like him singing while his throat is sore. And I don't like his singing; it's out of tune.