I did a reply recently to someone with similar need and posted 3 examples of motion controlled lights
Note how I use wait_template and how I define the automation so that they have mode “restart” so any motion in wait period cancel the actions and restart the automation. The examples take advantage of multiple motion sensors