There is a very popular free rules engine smartapp created by one of the grandmaster coders in the community. It is called rule machine. I think you’ll find it does everything you want and more.
Or if you have an iOS device and prefer to use a more graphical engine, SmartRules is a very nice $7 app. Also very popular. So the smartrules app doesn’t have as many different options as rule machine does, but it might be a little easier to use if it covers the situations you do want. Many people also use both.
SmartRules installs like any other app from the App Store.
To install Rule Machine, you need to copy the author’s code and “publish” it to your own account.
If you haven’t used custom code yet, you might want to take a quick look at the custom code FAQ just to get oriented. It’s really pretty simple.
After that you can either go directly to the user guide topic for rule machine, or start with a tutorial that another community member wrote.
Rule Machine User guide topic:
First rule Rule Machine tutorial:
There’s also a thread where you can ask for help in setting up through machine rules if you get stuck on the logic. (Again, you probably wouldn’t need help for the smartrules app because it’s just much simpler. But Rule Machine is more powerful.)