Oh boy, is that a point of confusion here in Brazil!
You’ll be safe anywhere more or less urbanized greeting anyone with a handshake. Women will be excused to greet each other with cheek-kisses more or less everywhere. Being a reasonably patriarcal society, in Brazil men will greet women, and they can start a handshake or a cheek kiss depending on area, both are fine mostly everywhere though a handshake is more professional and a cheek kiss less formal.
In São Paulo, a cheek kiss means ONE cheek kiss (lean your head to the left, touch the right cheeks). In Rio, that’ll be two. Elsewhere, it’ll be something from one to three kisses (the “three to marry” trope in some regions making this even more confusing than strictly necessary).
Men can greet men with handshakes, pound hugs (“man hugs”), actual hugs or cheek kisses depending on formality and proximity. A cheek kiss between men is a token of proximity and trust, rather than sexuality, though a few gay men will greet any other gay man with a cheek kiss.
Though this sounds like enough material for an Etiquette manual, it’s hard to get things wrong (especially if you lean towards formal or let the other party start the greeting and just follow along). You’ll know what to do. It’s a cultural osmosis things. Most gringos I host don’t sweat it.