This question already has an answer here:
My husband is a national citizen of Nigeria. He has a 5 year permanent permit to live in Lithuania. We are planning to fly to Nigeria through Istanbul and the time between flights is more than 15 hours. We would get a hotel from Turkish airlines. Does my husband need a visa while in Turkey?