Should a vent cap be installed under all the layers of shingles, or just the top most layer?
First off, three layers of shingles indicates that you need to redo the roof completely soon.  You're at your max, and frankly I think even two layers is a sign of lazy roofers.

That said, vent caps are most effective when installed so that the water runs onto them from the upper shingles and then back ONTO the lower shingles, as such:



So, you should definitely put the cap under ALL layers of shingles above, and over ALL layers of shingles below.