Build the firmware according to this: https://beta.docs.qmk.fm/using-qmk/software-features/feature_rawhid Add the content of keymap.c to the end of your keymap.c
Install pyhidapi: https://pypi.org/project/hid/
Install hidapi. Download binary release: https://github.com/libusb/hidapi/releases Copy the appropriate hidapi.dll into Windows\system32, reboot
Run testhid.py, it will change layers back and forth several times (noticeable if they have different light color)
Run autolayer.py to automatically change layers depending on the active window's input language (Windows-specific, English and Russian hardcoded, unoptimized - should install a global hook on foreground window change instead of polling in an infinite loop...
UPD: ... or not? there seem to be no such hook in Windows, you're supposed to install one for WH_CALLWNDPROC and then check if the message was WM_ACTIVATE - as there should be a shitload of window messages sent every moment, this may end up wasting way more resources than an infinite loop. Would WH_SHELL with HSHELL_LANGUAGE work for this case?).