You cannot use the return value of the
@InvocableMethod
in Process builder. The return values of these methods can be used only in flows or when invoked through REST API. Check this answer for more details: accessing the return value of an InvocableMethod in process builderaccessing the return value of an InvocableMethod in process builderRegarding how to pass two parameters, Override your actual method with another method which takes one parameter of List of primitives then split and call your actual method. Something like this:
public with sharing class ExampleClass { public static Integer innerMethod(Date d1,Date d2){ return d1.monthsBetween(d2); } @InvocableMethod(label='Example' description='Example') public static void innerMethodInvocable(List<Date> dates){ innerMethod(dates[0],dates[1]); } }