Say your repeat grid name is address
(this is the name of the repeat grid, not the field). Then on the field you can use the following constraint:
empty(../following-sibling::address) or . != ''
Essentially, you're saying that this field is always valid if there are no following address
iterations (which means we're on the last line), and other its value must be non-empty.