Gotcha!
You might want to get a sheet of vinyl flooring to use under his pen for now if he’s peeing on the carpet. You can get it pretty cheaply at hardware stores (I was able to order some from Home Depot and pick it up curbside recently, but not sure where you are in the world!). He could be marking the carpet if there are lingering pee-smells there.
Re-reading your initial post, is the main problem the bed? Beds can be a problem area, unfortunately because they are soft and smell strongly of humans. Some people have had success putting a shower curtain under a blanket on the bed, which blocks the scent and protects your bedding in case the bun does pee. Other than that most people opt to block access to the bed.
Perhaps some others will chime in with more tips. How long ago was he neutered?
.
.
.
The answers provided in this discussion are for general guideline purposes only. The information is not intended to diagnose or treat your pet. Seek the advice of your veterinarian or a qualified behaviorist.