Shadowcatcher, how to separate shadow and object
Your question is a bit confusing as to what exactly you want. Anyway, here is a way to split basically every object and shadow however you want, if this isn't exactly what you want you can definitely alter it with the methods shown in the nodes.