We visited Machu Picchu on May 7 and May 8 of 2019. We didn't have outright rain, but did have some (welcome) cloud and a bit of a sprinkle on the second day, when we were walking to and from the Sun Gate.
May is part of the dry season, and I thought early May was a good time to be there. Even if it does rain, it would likely be short-lived. The citadel WILL be busy, but not as busy as later in the season. If you can manage to visit the ruins later in the day, it will be less busy, since most people want to see the sunrise (although mornings can be hazy, anyway, so there's no guarantee). Keep in mind that numbers are restricted, and you need to have a timed reservation for the ruins (and for the bus up, although if you are coming from the Inca Trail, that might not be an issue). Once inside, you can spend as long as you like, although there are no washrooms in the citadel, so there is that limitation.
We made two reservations, in case of weather, and we ended up using both of them. The first day, we visited the citadel late in the day and stayed until sunset, just before closing. It was fairly busy when we first entered, but there weren't many people there by sunset, and the chinchillas came out and sat on the rocks. It was magical. When we went to catch the bus, we didn't have to wait.
The next day, we went early--not on the first bus, but we had a reservation for about an hour later. We had to wait a while for the bus. We hiked to the Sun Gate and back, and then looked at the citadel in a different light than the day before. When we went to catch the bus down, we had to wait about an hour to get on one, because there was such a lineup. This is just to give you an idea of the difference in crowds in the morning/mid-day vs. late afternoon.
Enjoy! It's a spectacular and special place!