Is there a way that, when you switch language inputs for your keyboard, the onscreen keyboard will automatically show up?
I asume you want to show an onscreen keyboard when changing your keyboard layout. One obvious approach is to use AppleScript, and that is what I've done here. I think this approach is not error prone, but it works.
At first, in the Systems preferences select the keyboards you want to use, and make sure you tick 'Show Input in menu bar'
Then check if your languages are available in the 'Input menu' in the top right corner of your menu-bar.
So, now the keyboards are available from the menubar. We can use applescript to invoke with the menubar and start your onscreen keyboard.
You can use Automator to make an Application or a Service of this AppleScript and and even attach a keystroke to it.