Every Tor relay has an exit policy, even if it's just "no". It's a list of accept and reject rules in torrc, read top to bottom, first match wins. Clients read these from the directory and only pick exits whose policy allows the connection they want to make.
A relay that shouldn't exit at all uses:
ExitRelay 0
ExitPolicy reject *:*
That's the safe starting point for a middle relay. Exit operators usually start from the "reduced exit policy" published on the Tor Project's community site, which allows common ports like 80, 443 and a handful of others while rejecting ones that attract abuse complaints, such as port 25 for SMTP and well-known file-sharing ports. Tor's default policy already rejects SMTP and private address ranges.
The policy is a trade-off between usefulness and hassle. An exit that only allows 443 still helps most web traffic and will see fewer complaints than one that allows everything. Whatever you choose, it's public, so researchers and users can see exactly what your relay will carry.
You can check the active policy on Relay Search at metrics.torproject.org once your relay is listed.