In a nutshell, you shoot on a colored background, in post, that color is removed to that other footage can show through in those areas.
As for how it technically is done, it's more involved than that, and more information than I care to type here. I've never seen chroma key details in a script. That's ususally set up by the DP after the script is done.
Again, there are places to get this info, but, it's more detail than I'm willing to sit here and type out all day. It's not a simple cut and dry process. It involved lighting, color selections, spacing, etc, etc, etc.