Rather choosing Rules, you can go with conditional formatting on Repeating Table.
Take a counter,which can count the no of rows in that repeating table and apply the conditional formatting to Repeating table saying,
if the counter = 4 the condition is "dont allow the user to insert and delete the row".
Fine, I will tell you the problem(in above case), if the user add 4 rows, it wont allow to insert new row and at the same time it wont allow to delete the row also.If this is fine you can go with this approach, otherwise
the only solution in that case is the programming.
If you go with programming, I can tell you the approach how to proceed further.