Married to a brazilian woman

hello
i am lebanese and married to a brazilian woman and a have 2 brazilian children living all together in lebanon
if i do my papers for permanent visa ,
after one year i can apply for naturalization
my question is should i stay in brazil for one year or can i live in lebanon and visit brazil every 6 months for a brief period ?
thank u

Staying in Lebanon and visiting Brazil for brief periods will allow you to keep your permanent residency, provided that you're not absent from Brazil for more than two years between visits.   You can't apply for citizenship, however, until you've lived in Brazil for one year continuously.  Naturalization takes a year or more to process after you submit the request,  and leaving Brazil during that time could result in your application being rejected, so it's not a process you want to start until you're ready to live in Brazil.