Are you referring to getting a Greencard? Buying a home does not guarantee you a residency even if you are on B1 or B2. You have to invest and get on the EB5 program but if your immigration application is pending through work then you may not be eligible.
I have worked with clients in this situation before with an immigration attorney. Feel free to email or call me if you need further assistance.