Hi & welcome to Ytalk
I have had that problem once (bedwetting) Tilly my older baby was about 6 1/2 yrs (now 10yrs) always slept with me. one night we just climb into bed to just watch Tv ( I watched) and she goes under the blankets and settles in and within a short period of time I felt this warmth around by back, I pulled the covers back and she had wet the bed

this alarmed me with a big red flag! next morning I called the vet and brought her in that same day, They ran numerous test's. and once the results were in he informed me Tilly had cushings disease. and somewhat explained what it was what it does> it causes her to be an excessive water drinker which I had noticed but didn't really take heed! So that was my experience with bed wetting. and I noticed you said he was 4 years old? Im not sure what age this occurs but I was told senior dogs? and Tilly was just 5 1/2 ys