green screen matchmove once the camera moves

I am quite new to after effects so I apologize if my problem is solved already somewhere (however I am not able to find it) I am facing the following: I am a using a green screen which actually forms only part of the background of my footage and also the camera moves. I am able to key the footage using keylight, but I am no able to have the picture or video that I replace the green screen with move with the camera neither am I able to get the replaced background get into perspective. I believe there is some tracking involved, but I have no clue. This is the footage I was refering to:

(it is part of a student film we are putting together)

I am would be extremely grateful for any tips, ideas or tutorials on how to solve this. many thanks