You just need to publish on the store in order to sell to other users.
You're probably referring to one of these things:
- You can install any app on your own device. This requires an Apple ID (but no $99 membership) and a certificate that Xcode automatically gets from Apple. The certificate is valid for 7 days, after which the app no longer launches. The bundle ID of the app also has to be globally unique.
- There's "enterprise" distribution that requires a developer ID and a certificate. Subject to terms of use. Apple can revoke it at any time. Sometimes Apple turns a blind eye to the misuse of this, but, again, it can and does revoke these certificates remotely disabling any apps signed with them.