Unless I'm missing something, both your stays seems to be <72 hrs, so you'll need 2 transit visas (assuming you are eligible for a eVisa/VOA), that would be cheaper and simpler than a multiple entry visa.
https://www.nairobi-airport.com/visa...ival_kenya.php