It is so hard for people to empathize/sympathize with the loss of a child, because they haven't experienced it.
When an elderly person dies, we say they had a great life. When someone who's been battling cancer dies, we say at least they are no longer in pain.
When a baby dies....no one knows what to say.
I totally understand that and I wish that none of us HAD to know what to say...but, for me, it's as simple as, "I'm so sorry, I can't even begin to imagine what you are feeling"...because that is the honest truth.
After that, just be there. Don't say, "call me if there's anything I can do", because I am never going to ask for help. Call me and say, "I'm stopping by tomorrow night with dinner" or "I'd like to drop this great new book off that I think you'd enjoy".
As time goes on, don't be afraid to mention my babies and their names. Yes, I will likely cry, but I will also be grateful that you are thinking of them also, that the world hasn't forgotten them, that you know that I will never forget them.