Partner profile is determined based on Output determination technique.
Configuration path: SPRO-> IMG-> Basic Functions-> Output Control-> Output Determination-> Output Determination using Condition Technique- >Output Determination for Sales Documents
A sample configuration is demonstrated in SD - Output determination configuration
Hope this helps.