Per my knowledge it is not doable to change a sub-site to the root site. Here is approach you can have a try.
If you have the site collection administrator permission, visit "http://yoursite/_layouts/sitemanager.aspx", you'll see a site manager, where you can do a move operation of all contents.
You can move your sub-site 2 and 3 to be the sub-sites of ...
I'm not aware of a powershell way to do this in SharePoint Online. I suggest you open a support ticket in the admin portal to see if Microsoft can assist with this, or you will need to use a third party tool like ShareGate to accomplish this.