Its because of stress or anxiety.
Kids feel the vibes of what is going on...and children too, have 'stress' whenever THEIR lives, changes.
This happens.
Just don't scold or punish him for it.
When my daughter started Preschool it was about the same time I was pregnant then had my 2nd child. She as well, started to have accidents. We merely talked with her about it, tried to comfort her... and did NOT make it an issue. We explained to her teacher as well. The Teacher, ALREADY knew... 'why' she was having accidents... and was very loving toward my daughter about it. It was okay. No pressure.
It will pass.
Talk with him and make sure he is okay... let him express himself to you.... all the time... and comfort him for any uneasiness about anything.
PLUS, your Mom(Grandma) moved in, but because she is "sick." A young child, much less and adult... does NOT automatically know, how to handle that.... emotionally. AND you are tending to her a lot. So, your son... is having TONS of things happening... which is not easy for him. He is so young.... they are not expert at understanding all of this.. nor how to handle it...
For night time, just put waterproof bed pad directly under him. It makes clean up very easy. I use those under BOTH of my kids, at night. No biggie.
All the best,
Susan