If you’re having issues joining Raid Battles, here are some tips:
Any number of Trainers can join a raid, but only in groups of up to 20 Trainers. If you’re unable to join the same group as your friends, the raid group might be at its limit. You can still join a public group and will be matched with other players.
If you see an error while trying to join a raid in person (as opposed to joining a raid remotely), make sure you are within the range of the Gym.
With a Remote Raid Pass, you can join any Raid Battle that's on the Nearby screen or tappable from the Map View. Up to 5 Trainers can join the same raid lobby with a Remote Raid Pass, though this number may be temporarily adjusted during specified time periods. If you try to join a Raid Battle remotely and 5 other Trainers have already joined remotely, you will be added to a new lobby. Avatars of Trainers joining remotely have a different appearance in the lobby.