Objects become eligible for GC when their scope ends and there are no live references to them or they become unreachable.
In your code above at the end you are setting a1,b1 and b2 to null.
so:
after the assignments and null settings
object a1 State: b1 = null, b2 = null and the a1 object has been set to null - so a1 is eligible for GC as there are no live references
object b1 has been set to null and is no longer referenced in a1 - so a is eligible for GC as there are no live references
object a2 is still referenced - so not eligible for GC
Although b2 is set to null it still has a live reference in a2 state and so is reachable - so not eligible for GC
I think this is correct, not 100% on it though.
The following slideshow from my website might help with understanding
The Heap