Merely *connecting* to Nintendo's servers with any trace of a non-official digital game can get you banned. This is not just pirated goods, but also your own dumped carts, or even homebrew NSPs or links. As mentioned its any trace, so merely deleting this stuff from your library isn't enough.
Additionally, any kind of cheats or even save restore in select Nintendo multiplayer games, depending on which ones are monitored. Again actually playing online isn't necessarily required to earn a ban.
What most people seem to get away with; running homebrew via album or title replacement. You can enjoy homebrew apps and emulators, or system plugins like overclocking and temp monitors. Just do not install any NSPs in the process, and mind the cheating.
If you want to do the first two things though, you will want to block access to Nintendo servers. Easiest way is via editing exosphere.ini to make your prodinfo (unique system identifier) appear blank. You can look into emuNAND tutorials if you want one part of your system for messing around with, and another part that is clean for safely going online.