The volume that is filled with foam is going to be the volume of the container minus the volume of the ball.
The container is a cylinder, so he will need the formula for its volume.
This is

.
The ball is a sphere, so he will need the formula for a sphere.
This is

.