It is essential that you have him seen by a doctor to rule out medical causes.
It isn't common but some children are not able to stay dry thru the night. Sometimes it's caused by their body not yet being mature enough. It can also be caused by stress.
After he sees the doctor and a medical/physiological reason has been ruled out, evaluate the stress level in his life. Perhaps, unwittingly, you and/or others in the family are a part of the stress. Find ways to alleviate some of it.
Why does he not go to the bathroom when it's obvious he needs to go? Does he have a physical or emotional reason? Is he developmentally delayed in other areas? How well does he co-operate with you in other areas? How is he doing at school? Perhaps a professional person, such as a pediatrician can help you make this evaluation.