The displacement is the shortest distance between the final point and initial point. The ball goes upward and come back to it's initial position. This means there is no difference between the final and the initial point. So here the displacement is 0.
As the the maximum height attained by the ball is h. Then it return to ground. So the distance travelled will be h+h i.e 2h.