First, if rules don't work, they usually throw an error in system messages. Are you getting any?
Second, is C1/C2 [None] valid for both members for that Account?
Third, if no system messages are populating and your metadata works, try writing a log rule to test if you're getting inside your if statement, and if you're not passing that check, confirm the value of HS.ENTITY.MEMBER and make sure it matches "E1" (so it's not showing something like "e1" for example).
Finally, I seriously hope you never tried to implement either of the above lines of code directly into your application... you'll be flooding your database as every undefined member gets populated with an 8. Hoping that was just sample code for here.
I do completely agree with Jeo123, please try to run a debug entry inside the loop and check if your rule is being run for that particular entity. Also please check the CustomTop attribute for the particular account for which you are trying to run the calculations. Also, if the Entity is part of shared hierarchies, try to run consolidation / calculation at both the parents and see what happens. The Custom members work with combination of Accounts based on the CustomTopMember. If you are expecting it to be calculated for a specific custom dimension member, please make sure it is part of the CustomTopMember attribute for that account. Also if possible please make sure to attach at least screenshots whenever possible to understand the issue better.