I have a friend from Egypt who has a valid tourist Schengen visa, which will expire by February 2018. He is intending to be in Europe in the beginning of December and he wants to apply/renew his tourist visa while he is in Europe. Is that possible? Or does he have to go back to Egypt to renew it?
It's usually not possible, outside of very specific cases (like falling ill and being unable to leave, in which case an extension might be possible). One option would be to apply for some national long-stay visitor visa (some countries offer those) but the general rule is indeed that short-stay visas should be obtained in your country of residence.
On the other hand, if he want to stay from the end of December to the end of February and only has a visa lasting until the beginning of February or something like that, he should be able to apply now for another visa to cover the missing weeks. Travelling on two distinct back-to-back visas is allowed and unproblematic (especially for multiple-entry visas, which I assume to be the case here).