Well, first you have to determine the actual bus bar rating of the panel in question. You can't leap to the conclusion that since the main breaker is X therefore the bus rating is X. Sometimes that's true but honestly, most 100A panels have 125A buses, and most 200A panels have 225A buses.
Once you have the bus rating, you multiply by 120% -- 125A becomes 150A and 225A becomes 270A.
Now you take that number and subtract the main breaker rating. (which again may not be the same as the bus rating). So for instance 150A - a 100A main breaker = 50A.
What remains is available for solar. The rating of the solar panels must be <= that number.
You are not required to have a solar breaker that is exactly that number. Breakers should be sized according to the instructions that come with the panels or grid-tie inverter.
If you are buying new equipment, you can use a "solar ready" meter-main which has an auxiliary breaker for solar, or even clever use of a Ranch Panel (meter+main+breakers+thru-lugs). In that case solar can be as much as the service size.