I am on B1/B2 visa and was planning to change into f1 visa. is it possible to change staying in US
It is technically possible, but the process is very inconvenient and it is much simpler and faster to just leave the US and get an F1 visa at a US consulate abroad and return.
Once you have gotten your I-20, you can apply for a Change of Status to F1 status by filing Form I-539. This costs $370 and it takes maybe 4-6 months for them to make a decision. You are not allowed to study on B2 status before your Change of Status is approved. This means that if you apply for Change of Status only a month or two before your school starts, you are likely to miss the start of your studies (because you can't study before it is approved, and the application takes longer than this to process).
Now, there is also another rule that the status you are changing from must last until 30 days before the start of your studies. On the surface that doesn't seem so bad -- if you visit for the summer, and your B2 status lasts until shortly before or after your school's start date, that will be enough, right? Wrong. Remember the part above where the application takes so long that you miss the beginning of your program? When that happens, your school will update your program start date to a later date (potentially more than once if your application remains pending). According to a pretty unreasonable USCIS interpretation, if the school postpones the start date due to the application being pending, you not only have to be in status 30 days before your original intended start date, but you have to be in status 30 days before your new, postponed start date.
This basically means that they can deny you because they took a long time to process your application! (The slowness of processing your Change of Status causes you to miss the start of your program, which causes your start date to be postponed, which causes you to be ineligible because you are no longer in status 30 days before the new start date.) You basically have to remain in status throughout the period of time the Change of Status application is pending, to make sure that it doesn't get denied. And B2 visitor status generally lasts no longer than 6 months, so unless you apply at the very beginning of your visitor status, it is likely the status won't last long enough through the Change of Status. USCIS's advice for this problem is that you should file a second I-539 (paying a second $370 fee) for an Extension of Status for your B2 status, so that, assuming it is approved, it "bridges" the gap in status and keeps you in status through your Change of Status to F1 application, so that that Change of Status can be approved because you would have been in status 30 days before the final start date.
So basically, doing a Change of Status from B2 to F1 is possible, but it takes a lot of money and time and stupidity, whereas if you went to a consulate for an F1 visa, it is usually issued pretty quickly. Plus, even if you do a Change of Status, if you need to leave the US during your studies, you are going to need to get an F1 visa to return anyway. So you might as well save the trouble and get an F1 visa to begin with.