So at the moment, you cannot change or assign TEA data values with program rules when you enter data in program stages.
Here is some further information on that:
“The problem with this is that the assignments to tracked entity attributes will be triggered when you are in the registration form, or if you open the edit profile widget - but generally not when you enter data in program stages.”
I have talked to the devs and since this is a feature, not a bug, I have created the following issue: [DHIS2-11025] - Jira - follow that issue for updates.