How to acknowledge my professor who isn't helping much with my master's thesis?
You could get around it by thanking him for the opportunity to work in his lab and the chance to explore this particular avenue of research.

All at the same time, you can thank the PhD student for all the insightful chats and helping hands throughout the project which should be clear to the reader who was primarily advising you.