Alone, swearing is not punishable. When you start directing that swearing at other players in a negative fashion, that's when the problem arises. You could say things like "Shit, sorry I missed my ultimate" or "Fuck yeah, that was a great play" without getting punished. However, saying something like "You're fucking shit at this game. Uninstall." will indeed get you punished because it really doesn't have a place here.
As for the other things you mentioned, Riot does punish those actions. For account sharing, if it's for a game or two, my guess is it probably won't be punished, but Riot does punish major forms of account sharing like Elo Boosting. Leaving/going AFK is also punished. Now, if you don't believe that the punishment for leaving is sufficient, that's a different topic that we can discuss if you wish.