What you are try to do is called a nested if, basically you want to put your second if in the else condition of your first if like this:
AND(NOT(ISBLANK( Assigned_On__c)), NOT(ISBLANK(Due_Date_to_Partner__c))), Assigned_On__c - Due_Date_to_Partner__c,
AND(NOT(ISBLANK( Assigned_On__c)), NOT(ISBLANK(Due_Date_to_Customer__c))), Assigned_On__c - Due_Date_to_Customer__c,0
Another way to write it could be:
IF(Assigned_On__c > Due_Date_to_Partner__c, Assigned_On__c - Due_Date_to_Partner__c,
IF(Assigned_On__c > Due_Date_to_Customer__c, Assigned_On__c - Due_Date_to_Customer__c, 0))
Smaller version(82 characters) based on Shannons answer:
BLANKVALUE(Assigned_On__c - BLANKVALUE(Due_Date_to_Partner__c, Due_Date_to_Customer__c), 0)
This will give you 0 vs null when any of the dates are null.
Edit: Switched all formulas to BLANK vs NULL based on Shannon's note and docs:
Use BLANKVALUE instead of NULLVALUE in new formulas. BLANKVALUE has
the same functionality as NULLVALUE, but also supports text fields.
Salesforce will continue to support NULLVALUE, so you do not need to
change existing formulas.
Use ISBLANK instead of ISNULL in new formulas. ISBLANK has the same
functionality as ISNULL, but also supports text fields. Salesforce
will continue to support ISNULL, so you do not need to change any