If you are talking about the Rift / Rift-S / Quest with Link then you can have multiple accounts that you log in and out of. Any games bought on one account are only on that account, there's no sharing.
If you are talking about the Go / Quest (stand alone) then changing accounts is much harder, the only way to log out is to factory reset the headset, wiping it and requiring the whole setup process again.
will it get rid of all my games if i factory reset?
It will delete them from the headset, but you will still own them on the account that bought them and can reinstall. If you are swapping between accounts, games can't be shared unless you buy them multiple times (once for each account that you want to play them).