When installing a roof cap on a roof where there are three layers of shingles, do i trim away just the first layer of shingles or should i trim away all three layers to slide the cap underneath.
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.
Given that multiple layers of shingles should be overlapping each other, I think it will be difficult to get the vent under all the shingles on the top half of the cap without cutting shingles and risking water intrusion. I'd suggest going under just the top layer of shingles above the cap. And of course have it exposed on the bottom half, like Greebo's photo shows.
When you get the roof replaced (they should remove everything down to the plywood and start fresh next time), have the vent properly installed under the shingles above and over the singles below.