You'll both hear and see on the map when the sandworm is about to appear. He'll always appear under your hero or soldiers so make sure to change their rally points before the worm appears and you should be fine. If you're having trouble try coming back later when you've got more upgrades on your tower and a higher level on the hero: