Hi William,
In general, rainy season in Costa Rica is from May to November, with dry season December to April.
For a dry season visit, you could try anytime during those dry months. You’ll experience little rain if any. Blue skies. Great weather.
The height of rainy season, marked by the rainiest days and most average daily rainfall will be September and October. You’ll get some serious downpours this time of year. So if you want to experience “the worst” of rainy season that would be the time to go.
I should add that most expats – and locals, of course – quickly adjust to rainy season. For most of the season there will be a clear morning and then a rainy afternoon, stopping early evening. It often cools quite a bit after a good rain. So you kind of plan your day around it. You even start to enjoy the rain – seriously. 🙂