Combining those two formulas would give you this:

=AND($E4=$H4,$E4<>"",COUNTIF($E$1:E4,E4)<3)

Untested in Data Validation.