Hidden units

How do I make it so opponents cannot see units below the top one in a stack?

I figured it out

How do I make it where my opponent can’t see any of my units unless I reveal them as a result of their searching?

You give the unit(s) the invisible trait. In the attached picture The trait is in the prototype for ‘USA’ units. So any unit with the USA prototype can be made invisible.
Note I did not actually “add” the trait to the prototype just using it as an example.