Upvote:3
If you're leaving Tanzania on an international flight, then you will pass immigration and get a stamp, that's an exit, and your visa (if it's a single entry) will be consumed.
Your arrival back in Tanzania, from Kenya, will be considered an international flight, so you will pass immigration, and then you will need a visa, which will be expired already if your visa is single entry as I just said.
So, you will need a multi-entry visa.