Since I live here full time, I've never personally had to worry about the amount of time I spent outside of the country during my residency process.
However, I have a friend who is an engineer on a cruise ship, who works roughly 6 months out of the year, and is here only six months out of the year.
According to him, passed on from his lawyer, the requirement is that you must be here 181 days of the year. He has to schedule his work carefully, including travel time, to make sure he maintains that time. I would verify that if I were you, but I believe it to be true.
The comment below related to 2-3 months spent here and be done with the residency process is, in my opinion, overly optimistic. If everything went perfectly, you would end up with temporary residency approved within that period. That's if everything goes smooth as clockwork, which is not a great likelihood.
Permanent residency doesn't come, even for those marrying a citizen or resident, immediately. I married a resident (from Paraguay) and got my precaria the day I went to immigrations and filed. It took almost a year before my temporary residency was actually approved due to various little gotchas related to our marriage out fo the country and my wife's marital status on her DNI.
After two years comes the permanent residency.
BTW - the two years of temporary residency required starts when you receive your precaria, not when your temporary residency is approved. I got my final, permanent residency DNI as my first DNI - never did see a temporary residence DNI due to complications (99% idiocy on the part of immigrations, including lost files and changing my wife's DNI status to Married!). I got my permanent DNI almost 2 1/2 years after I started the process. I had to use my precaria to enter and leave the country during that period.
While you might be able to get away with getting the temporary residency and the DNI that goes along with it in 2-3 months, I don't know that leaving the country at that point and allowing your permanent residency to just "happen" by inertia of the process is very secure. Your entry/exit records are available at the time of the approval for permanent residency and I don't know that they won't look at that 181 day restriction and deny your residency.
Once you are granted permanent residency, I don't know if there are restrictions on the amount of time per year to stay here to maintain it.
As far as all that goes - you don't need residency until you actually live here anyway.