Hot water with honey and/or lemon can help. It can be tea or just hot water. Chamomile is a nice calming tea.
Take a hot shower/bath before bed.
Both of these will loosen the mucus, letting him cough out a lot more. Hopefully it will then calm down so he can sleep.
If this goes on for more than a week without improvement, please get him tested for pertussis (whooping cough). Make sure you test *before* starting any antibiotics, or the test is invalid. Test even if he is fully vaccinated: the vaccine has a 30% failure rate. Treatment for pertussis is really easy *if you catch it early*. Once you get to the "whooping" stage, treatment doesn't help much.
Hope your kiddo feels better soon.