Publishing a paper - not enrolled in university
No, you do not need to be enrolled in a PhD to publish scientific papers. You don't need to be a professor either. It's common, but by no means mandatory. For example the game Arimaa was invented by Omar Syed. He published a paper introducing the game and has never earned a PhD.

As for how to publish - it's no different from those who have PhDs. Go to your target journal's website; it will have instructions for authors on how to submit the paper.