A former tax and real estate attorney ran a nationwide scheme that helped his customers avoid paying taxes on as much as $840 million in capital gains, the federal government told an Idaho federal court Thursday.