On Apollo 15, 16, and 17 NASA filmed the Lunar Module taking off and leaving the moon. With no-one on the moon how could the the camera move to follow it and who brought the exposed film back to Earth?
It depends on which "film" and mission you are referring to. (The original question referred to "the first moon landing". Later edits refer to the last 3 landings.)
For the first moon landing, Apollo 11, the lift off was filmed with a motion picture camera inside of lunar module looking out the window. Obviously they carried that camera home with them and develop the film after returning to Earth. (The landing was filmed the same way: camera pointing through the window.)
For the last three missions, Apollo 15, 16, and 17, those were recorded from the TV camera on the lunar rover and used video transmission. No film and no processing was involved.
Elizabeth Howell — Universe Today 12/16/14 11:20am https://io9.gizmodo.com/how-nasa-captured-this-iconic-footage-of-apollo-17-leav-1671650186 provided the explanation also supplied by Uwe, above. It was a live TV/video feed from the LRV (lunar rover). Repeated on several missions.
Edit 22 July 2019 - Quotes from link provided to complete this answer so information is not lost due to link rot.
When Apollo 17 lifted off from the moon 42 years ago this week, a camera captured the movements of the spacecraft — even though nobody was left behind to, say, establish a lunar base.
... a camera on the lunar rover that could be controlled — or even programmed — from Earth
Now, the way that worked was this. Harley Weyer, who worked for me, sat down and figured what the trajectory would be and where the lunar rover would be each second as it moved out, and what your settings would go to. That picture you see was taken without looking at it [the liftoff] at all. There was no watching it and doing anything with that picture. As the crew counted down, that's a [Apollo] 17 picture you see, as [Eugene] Cernan counted down and he knew he had to park in the right place because I was going to kill him, he didn't — and Gene and I are good friends, he'll tell you that — I actually sent the first command at liftoff minus three seconds. And each command was scripted, and all I was doing was looking at a clock, sending commands. I was not looking at the television. I really didn't see it until it was over with and played back. Those were just pre-set commands that were just punched out via time. That's the way it was followed.