With some hit and trial I found the solution . "from" component for AllRemainingRequests is troubling . When I put following definition for AllRemainingRequests it works fine .
<rule>
<name>AllRemainingRequests</name>
<from>(/.*)</from>
<set type="status">404</set>
<to last="true">/error/410.html</to>
</rule>
Only change is "/"