Control your water in take a few hours before you go to bed. Space out your water intake during the day
But remember this: The amount of times you pee is not an indication your getting enough water. The color of the urine is.
If its CLEAR your getting enough water
If its a shade of yellow your dehydrated
There are exceptions, like when you take too much vitamins, the urine then can get quite dark yellow (body getting rid of the extra)
But generally if the urine is clear your hydrated.