Upvote:5
Your Hungarian residence permit allows you to visit other Schengen states as if you had a C visa, i.e. 90 days out of every 180 days. To stay any longer, you would need a German D visa.
Renting a flat or house should be possible, but doing so will draw attention to the fact that you're living at least part of the time in Germany and not in Hungary. (As a resident in Germany, you have to register all your residences with the municipal offices and you have to designate one of them as your primary residence for tax purposes, etc.) This could bring extra scrutiny to the question if you're following the 90/180 rule.