I rescue cats. I wouldn't place a cat into a flat if he'd previously had access to a garden but this is different and I sympathise with your dilemma.
Rehoming would be a last resort for me, especially if you're planning on moving to somewhere with a garden in the foreseeable future.
Before considering that option there are things you can try. Litter trays need cleaning very frequently - some cats won't use a tray again even after just a small wee. Some won't use a tray which others have used.
Most cats won't use a tray which is near their food or water. If yours are, I'd suggest that you move them. You might need another one or 2 trays to give the cats options of a clean one at all times and in different rooms (one in the hall, one in the bathroom with the door kept open?).
Try a covered tray. Some cats prefer them. If yours don't seem to get to grips with the swing door of a covered tray take it off until they've got used to using it and then replace it later. Many a time I've had to shove a cat through a covered tray's door to teach him how to get in and out! Once they catch on to how to get out they generally sus that getting in is pretty similar.
Regarding the peed on carpets, wash them several times, thoroughly, with either washing powder solution or with a pet shop bought cleaner made for the purpose. They'll return to the place which smells of pee time and again if you don't (and don't use bleach products because the smell is like their pee to them and encourages rather than deters re-use).
The peeing may not be directly or wholly related to being without a garden - it may be stress related due to the move or to the new baby (congratulations, by the way!).
You can get stress relieving products from your vet or from a pet shop to help address this. here's one example
Your vet can advise too. A phone call should do it, without cost.
If everything fails then rehoming might be your only kind to the cats and keep-you-sane solution but there's a long way to go before you need to get to that stage.
If you do need to please don't hesitate to drop me a pm for pointers on how to find a good rescue. Good luck.