Can a Kenyan citizen studying in Russia and temporarily visiting family in Kenya apply for a Schengen visa in Nairobi and not in Russia, where he has his residence?
The rules in the Schengen Visa Code (article 6) are:
An application shall be examined and decided on by the consulate of the competent Member State in whose jurisdiction the applicant legally resides.
A consulate of the competent Member State shall examine and decide on an application lodged by a third-country national legally present but not residing in its jurisdiction, if the applicant has provided justification for lodging the application at that consulate.
So if the Kenyan in question is not actually residing in Kenya, he cannot have his visa application decided there, unless he can provide a really good reason why he lodged it there and not in his country of residence. (And "it's easier for me that way" or "I neglected to apply before I left home" doesn't count as a really good reason).
As a practical matter for the applicant, his main hurdle to clear is to convince the consular officer that he has sufficient ties to a country outside Schengen to motivate him to leave the Schengen area before his visa expires, rather than overstay as an illegal immigrant. Someone who doesn't reside in Kenya would have a hard time convincing the consulate that he has such ties to Kenya (since whatever those ties are, they haven't so far been sufficient to make him choose to live in Kenya rather than Russia), so he would need to argue that he has sufficient ties to Russia. And the consulate that has the necessary experience in judging the strength of ties to Russia (and the trustworthiness of documentation offered to prove such ties) is the one in Russia.