Photoshop or Gimp, at least any program that allows layering.
1
Take a series of images without moving the camera... make sure to place the person in a believable amount of space so when you layer them it is believable.
take a photo of the background without the subject.
Then when you load into photoshop. Import each image as a layer. with the foremost subject/pose on the top layer.
erase parts of each layer to expose the other subject behind the last. when you get to the bottom canvas layer (background) import the subjectless environment layer.