CMOS gates have to be connected to
either a high or a low, the inputs can
not be left floating as is called.
Here I have one gate with the inputs pulled up, and the lower and gate with the inputs pulled down, you use the spdt switches to input either a low or a high.
This is for demonstration only.