You may fly without ADSB under the Class B or Class C shelf provided you remain outside of any Mode C veil.
§91.225 tells you where you cannot fly. It says you cannot fly within the lateral boundaries of the Class B or C airspace or above the airspace. It does not say anything about under the shelf.
Here is an example of one such area:
You can fly under 2,700' below the Ontario Class C and in the small slice of Class B you can fly up to 8,000' if you stay away from the Class C.
Paul Bertorelli has a good explanation on YouTube. (Updated link.)
(d) After January 1, 2020, and unless otherwise authorized by ATC, no person may operate an aircraft in the following airspace unless the aircraft has equipment installed that meets the requirements in paragraph (b) of this section:
(1) Class B and Class C airspace areas;
(2) Except as provided for in paragraph (e) of this section, within 30 nautical miles of an airport listed in appendix D, section 1 to this part from the surface upward to 10,000 feet MSL;
(3) Above the ceiling and within the lateral boundaries of a Class B or Class C airspace area designated for an airport upward to 10,000 feet MSL;
- Except as provided in paragraph (e) of this section, Class E airspace within the 48 contiguous states and the District of Columbia at and above 10,000 feet MSL, excluding the airspace at and below 2,500 feet above the surface; and
(5) Class E airspace at and above 3,000 feet MSL over the Gulf of Mexico from the coastline of the United States out to 12 nautical miles.