You have a tricky situation. You are not in valid status now if you have not been working for the H-1B employer. You can try to apply for a change of status (COS) to F-1, but it is unlikely that CIS will approve the change since you can't show that you are maintaining valid status at the time of filing the COS.
If you travel outside the US to a consulate to get an F-1 visa, you might not be approved because it will be difficult for you to show nonimmigrant intent. "Nonimmigrant intent" means that you need to show that you intend to return to your home country at the end of your studies. Having been here in H-1B status, especially with a US citizen child and permanent resident wife, will make it very difficult to show the required nonimmigrant intent.
I recommend speaking with an experienced immigration for formal legal advice.