@ConditionalOnExpression can be used in this way to achieve condition X or condition Y but not both. I tested this code with the same application.yaml provided.
@Bean
@ConditionalOnExpression("#{('${app.config.inside.prop}' == 'a' && '${app.config.outside.prop}' != 'a') || ('${app.config.inside.prop}' != 'a' && '${app.config.outside.prop}' == 'a')}")
public CustomBean customInsideOrOutsideNotBoth() {
System.out.println("app.config.inside _or_ app.config.outside _not_ both");
return new CustomBean();
}