If you get picked in the lottery but do not file a H-1b you will remain in F-1 status. However if you file the H-1b and it gets approved you will now be cap exempt. If you do not want to change immediately to H-1, it would be best to file your H-1b as a consular process without requesting a Change of Status, so you can remain in F-1 status and at the same time take advantage of getting picked in the lottery and getting a H-1 approval that makes you cap exempt. You can change to a H1 status by leaving the country and getting a visa and entering on your H- 1 or filing a change of status while remaining in the US.
