How do I assign an action to long pressing the home button?
Macrodroid doesn't offer an action based on  home key trigger. Macrodroid developer in app forums says


  It's impossible to create such a trigger because the home button is a fundamental part of the OS and there is no way to intercept the button press.


I don't know  Tasker, but guess the same limitations would apply, so you would need to find an alternative way. One method below:

Since you are on CM, you can use Gravity Box Xposed module

To kill foreground app

Navigation keys action &rarr; Home key &rarr; long press action &rarr; Kill foreground application 

To kill a particular app - combination of Gravity Box and Macrodroid

Navigation keys action &rarr; Home key &rarr; long press action &rarr; Custom actions &rarr; toggle applications to reveal shortcuts &rarr; Macrodroid Shortcuts &rarr; Add new macro

Trigger &rarr; Empty Trigger

Action : Kill application &rarr; choose application from drop down menu