The seller should be out before you close on your sale, you will want to complete a walk through prior to closing and make sure everything is in satisfactory condition. When you close you should be able to get the keys and take possession of the home. If you let the seller stay in after you close, they can become your tenant by law and become your problem to evict, clean up after or pay to fix anything they take or break
Generally the property is delivered vacant at closing. In some instances when that is not practical, the buyers attorney will hold a predetermined amount in escrow and include a per diem fee in the agreement allowing the seller to stay 2-4 weeks post closing which covers all of the carrying cost (PITI).