So sorry to hear about your dad. My DD is about to lose her last grandparent at the age of 8, so been through this a few times in the last couple of years, the last time was with my DM last year (4 months from diagnosis to her passing).
Kids pick up on everything so being honest is key. Death is part of life, and it's something sadly they will experience at some point.
We explained that grandma was unwell and doctors were helping her but couldn't make her completely better again. Sometimes people can't get better, and all we can do is make them feel comfy and loved. She did ask if she would die, I said everyone has to at some point, and yes, she might but we don't know when that might be. She processed a few days then asked more questions. I think as long as they know they can ask things, it helps them process the news.
I would say, in our case this was the fifth time in a little over three years we had to break news like this to her (this breaks my heart) so by this point she was more aware of what was happening and asked more frank questions. Don't be surprised if he asks you random questions at odd times! My daughter did, sometime la completely catching me off guard but I just tried to answer any question appropriately.
We also informed the school fairly early on so they could help support, they were fab, making sure she knew she could talk to someone if she had questions or concerns, and they were prepared when the end came. They also sent some books home for us to read to help explain things.
Only you know your son and if telling them early is right. For us it was, as it helped prepare our dd for the loss and to help understand why I spent so much time running back and forth! Sending best wishes