You emigrate to an EU or EFTA member state and are also not (no longer) employed in Switzerland. If you are not a posted worker, there is no possibility to remain insured under OASI legislation. You will find information about this in the brochure Leaving Switzerland and moving to an EU or EFTA member state.
You move to a country outside of the EU/EFTA and are no longer employed in Switzerland. Provided you comply with conditions, you can join the voluntary insurance scheme.
More useful information is available here:
Leaflet 10.02 - The voluntary old-age, survivors' and disability insurance scheme (pages 23-29)
Leaflet 10.03- Citizens of States with which Switzerland has not concluded an Agreement on Social Security (pages 41 to 52).
