How is the «Apply Customer Tax» («Before Discount» / «After Discount») option handled?

How to setup the «Apply Customer Tax» option in accordance with the Russian tax law?