Hi,
- add another trigger for clearance of your motion sensor
- add ID’s to your triggers
- never use devices but entities
- use these ID’s in your actions ‘as triggered by’
As stated in How to help us help you - or How to ask a good question → Format it properly use YAML code instead of pictures.