So sorry for your loss. My parents did a lot of things right, and a lot of things wrong, but they always included us in funerals where we knew the person.
My aunt passed away this January - she had advanced stage Alzheimer's, and the children had visited her even when she was pretty far along. We had talked about how sick she was beforehand. I was honest with them, in a 3 & 5 yr way - from the start.
We had to transport her to New York for her funeral, but before we did, we wanted to have a private viewing for just my father. I went and took the children with me to support him. I showed them the casket, told them how it looked like she was sleeping but that really she had died, her soul (had to explain that concept too!) was in heaven with with God. Then I said my goodbyes and got ready to go. My five year old hesitated. I asked him if he was ok, and he said he wanted to say goodbye one last time. I offered to go with him, and he said yes. So hand-in-hand, we went up to the casket. He stood back, and silently waved a little goodbye, then turned away. It brought me to tears.
Once we got to New York, we had a wake there that they were at briefly, then the funeral and burial. Sadly, a few months later, another uncle passed away, and they went to the wake with us (open casket).
I believe in being honest, including them, not imposing on them, and taking your cues from them. I remember my grandmother's funeral at 6, my grandfather's at 11, my grandmother's at 16, and my mother's at 19.... and many others. It's an important part of life that only you can teach them.