It is not that we keep His commandments first and that then He loves but that He loves us and then we keep His commandments. This is that grace which is revealed to the humble but hidden from the proud.
Grace is something that comes to us when we somehow find ourselves completely available, when we become openhearted and open-minded, and are willing to entertain the possibility that we may not know what we think we know.