Company has been sold, L1B VISA transfer to H1B


I am currently in L1B visa and will expire in June 2020 due to the company will be sold to another company. But the good thing is I have got H1B this year and will be effective in October. And the new company is going to hire me. And my question is can I legally stay in the USA but no working during the period from L1B visa expired in June to the effective date of H1B.

Do I have to leave the country to re-enter again? Or I can stay in the USA waiting for the effective date of H1b?