Haven't tried it, but this might work by dragging both shots in after effects, setting the layer with the subject to "difference", which shows the parts that are different. You can then pre-compose both layers, drag in the footage with the subject again, put it on top of the precomp and then add levels to the precomp, dragging the rgb curve up so that the image becomes only fully black and fully white, giving you the luma-mask for the subject. If you now set this precomp as the luma-mask for the shot with the subject, it should subtract only the subject and cut out the background.
Here are some reasons why this shouldn't be an alternative to greenscreens:
You really need to make sure that the camera, as well as the background stays exactly the same for both shots. Any difference will produce bits you need to mask out using a garbage-mask.
Because nearly all cameras compress the captured images, those blocky compression-artifacts will get masked out as well. This might result in messy edges and ugly smudges, especially while moving rapidly.
When for example a hand is in rapid motion, the background will shine through the blurry hand, because the difference will detect it as if its a completely opaque foreground.
Now some reasons for why you should use it under some circumstances:
- You won't have to deal with "spill", which is the color of the key-screen (usually green) that gets bounced onto your subject. Cleaning up spill isn't magic, but not having to think about this issue might save you some time.
- You don't need to buy and set up a proper greenscreen, which - especially for indie-filmmakers - can be a pain in the rear.
I hope I was able to help :)