When they are young, the difference between a boy and a girl is a hole versus a slit. Even vets and breeders can be wrong at times. It is so difficult. If you do a google search, I’m pretty sure there are pictures out there showing the difference. If your bun is a boy and he is 4 months, his other boy bits should be making an appearance. If you are able to flip him over, look for a couple of pink patches (about the size of your thumb) on either side. Note they will be forward, rather than behind like on a dog or a cat. Absence of family jewels does not guarantee a girl. But if they are there, then it there is no mistaking him for a her!
It might be helpful to take him to the vet to have him sexed too. You will want to make an appointment anyway for a wellness check and to discuss neutering (or spaying if it’s a girl).
For litter training, you are on the right track. Make sure there is nothing on the floor that could cause confusion to him. Keep picking up after any accidents and placing them in the litter box. Remember he may not be 100% consistent (or as consistent as he can be) until after he is neutered.