Subcontracting courses?
There's no possibility whatsoever that this could work.  To elaborate on Pete L. Clark's answer, here are some reasons:


The purpose of a teaching requirement is to have courses taught by the professor, not to have the professor arrange for some random person to teach instead.  The administration and other faculty members would be exceedingly unhappy if they found out this was going on.  Note that there are certain circumstances (called a course buyout) under which grant funding can be used to hire a replacement lecturer so the PI can focus on research, but this can only be done with university approval in advance.  The replacement would be hired through the usual university hiring process.
I suppose this depends on the laws in your country, but I can't imagine labor laws permit hiring someone informally in exchange for food, shelter, and conversation.  No university would tolerate this, since the legal risks are enormous.
Even if it were legal, it's obviously exploitation.  Universities sometimes exploit people, but I've never heard of any university going so far as this.
What if you do a terrible job, or stop showing up, or assign bizarre grades, or harass the students, or try to blackmail the professor?  No university is going to let a random person teach a course without at least some minimal screening or oversight, and no sane professor would accept an unknown stranger's offer to teach their course instead of them.  Even if you just want to be an informal teaching assistant, there's still way too much potential for things to go wrong.


You could offer to give a guest lecture as a volunteer, but I doubt anyone would take you up on that offer unless they knew you well enough to be confident you'd do an acceptable job.  Aside from one-off possibilities like this, you don't have any options outside of the regular process.  You could try to become a graduate teaching assistant or adjunct (depending on your background), but working under the table is not an option.