Like JCC said, anywhere below the layer helps but you can
still be detected by sonar.
The layer is an "interface" between warm water (close to the surface) and cold water (well below the surface).
Picture yourself in a fishing boat on a crystal-clear lake, you look down thru the surface of the lake and spot a fish just below the surface. You take a frog gig and attempt to spear the fish, aiming directly at what you see. Well, you will
miss!!!
Why? Well the "interface" between the air and the water refracts the light rays, they are "bent" so that the target you are looking at is
not where it appears to be from your point of view. You can still see it, but it is not where your senses tell you it "is".
If your fish was lying on the beach, above the surface of the water, it would be no problem to spear him, right?
The thermocline does the same thing, except with sound waves. When you get below the layer, the enemy still knows you're there but it's much harder for him to pinpoint your location since his active sonar is refracting off the layer. Or, if he's listening passively, your sound emissions are also refracting off the layer.
In either case, the sonar return received by the DD will appear to be coming from someplace that it's
not. And as V.C. Sniper said, the deeper below the layer you are, the more the return gets refracted. Once the DD's find me, I'll generally dive to 400+ feet, go silent and creep at 1-2 kts. They're dropping DC's in my general area because they have a rough idea where I am but it's rare for one to hit close enough to damage me...
However, make too much noise and you'll eventually be pinpointed

The layer is
not an invisibility shield!
DH