It sounds like you are looking to rent for just a couple of months before you close, so it sounds like you want early possession, correct?
In this case, you have a couple of different options:
You can do a straight-up purchase contract with a closing date in August, with pre-possession specified in the contract, during which time you will pay rent for that privilege. The specifics of the rental arrangement will likely be negotiable, based on the other terms of your contract. It is not likely your entire payment will go towards a down payment; it is more likely a portion of that can be allocated towards your down payment.
Pre-possession can be tricky, and many attorneys frown upon it simply because there is too much room for murky liability issues to arise, i.e., you break a major mechanical while it is still owned by the seller prior to your closing date. Another worry is your moving in prior to contingencies being met, i.e., mortgage. I can't imagine a seller's attorney allowing you to move in while there is still the chance you can back out. However, if your attorney and the seller's attorney can work out an amicable agreement that feels safe for all parties, it may work.
The other option is to do a rent-to-own with the option to purchase. In this case you will sign a lease with an option agreement, in which a date will be set by which you must activate your option to buy. You will put down option money (again, this is negotiable, but typically a couple+ months rent). During this time, you will likely pay above-market rent, of which the "above-market" portion will be allocated toward your down payment. When you are ready to decisively purchase, you will write up a contract with a closing date. The option money will go toward your down payment, and you will continue to pay rent until the closing. If you choose not to activate the option to purchase, you will forfeit your option money. These types of agreements are usually for longer-term leases, so it may not be the best option for you.
A third option is to do a lease purchase. In this case, you will sign a lease for a certain time period, AND a purchase contract with a set closing date at the same time. As with the rent w/option agreement, you will likely pay an above-market rent for the time period leading up to your purchase. With this type of agreement, you are bound to consummate the purchase, so you need to be sure you will qualify for a loan.
In fact, with all of the options, it is best you already know your financial situation prior to entering into of these agreements.
I strongly recommend you work with a real estate attorney to formulate the agreements to your benefit and to protect your interests,