How to compute NOR part of polygon A & B?

I am going to compute the NOR part of 2 polygon A & B. I know its easy to do with the tessellation function but I want to do it with the stencil buffer. The example for stencil testing that given by the redbook is too difficult for me to understand. Thanks.