It would also be possible to rotoscope rather than using green screen (this involves drawing round the subject to create a matte, and then animating the matte, sometimes frame by frame) but in most circumstances keying a colour out is the easiest solution.
It's a fairly simple process, but there are still a lot of easy to make mistakes, particularly if you haven't done any effects work before. Let's say we're trying to document a simple conversation between B (the character in the background) and F (the character in the foreground, whose arm overlaps B at some points).
1. Set your camera up, framing for both B and F - stand in people/mannequins/any kind of marker will be useful here. This will be what is called a "locked off" shot in the effects world - nothing should change, including tripod position, pan/tilt, exposure, focal length and focus. If you decide you need to change something halfway through filming, you'll need to start again.
2. Film B doing his dialogue. It may help to have a small marker where F's eyes will be, so that B is looking in the right direction.
3. Set up a green screen between where B was and the camera - it must be positioned so that F cannot overlap B with his arms or anything else. I won't go into too much detail, but the green screen needs to be brightly and evenly lit.
4. Now you need to film F's dialogue. Again, it may help to have a small eyeline marker for where B was sitting.
5. Let's go through the steps on your computer now. You'll need to drag both clips on to the timeline, with B's shot on the bottom and F's shot on the top, and sync them up so the dialogue makes sense.
6. You now need to cut out the useless parts of F's shot - all you want is the green screen and the actor. In After Effects you would use the pen tool to create a matte; if you were doing a rough composite in Final Cut, I'd use a garbage matte.
7. Key out the green screen - the more evenly you lit it, the easier this will be. You should now be able to see B, and F's arms will be able to overlap him.
8. Edit this wide shot together with your close ups!
If you're really keen on getting into digital effects work, I'd would highly recommend buying, reading and re-reading
The DV Rebel's Guide by Stu Maschwitz - it explains how to approach this effect and many others with much more clarity than I've managed.