I know Hume believes substance is an illusion based on habit but how does he arrive at this belief? Related to this what is his opinion on physical objects?
It's like this: Think of a green ball. Now, remove the color from that ball. Remove the fact that it is spherical. Remove the fact that it is made of rubber and as such bounces. Strip its qualities away from the definition and imagine only the "substance" that is left behind without qualities. That substance is undefinable, unrecognizable.
This, to Hume, summarizes why substances are an illusion or habit. We see the ball and ascribe these qualities to the definition of said ball. When we see this green, spherical construction of rubber, we think of a green ball. Habitually, we define this collection of qualities as a green ball.
Therefore, there is no substance, only a collection of qualities. Furthermore, Hume does not take a stance on physical objects. Rather he takes a stance on our belief about reality, such as gravity, even when we have no reason to have these beliefs.