In April 1983, Biff discovered that Doc had built a time travel chamber. Then, in May, he discovered that Marty McFly visited Doc at the asylum after Marty had received the letters that Doc wrote in hopes of getting him to become his assistant to make his time travel back to 1955 a reality.
Biff then blackmailed Doc into using the time machine, saying he'd kill Marty if he didn't, just as he did years earlier with his father. He told Doc to send him to 1996 so he could pick up ten years worth of almanacs and business books so he could play the stock market, which he could use to show the American public that he is a savvy businessman.
Instead, Doc used a remote control override to send him back to March 18, 1884. Upon his arrival from 1986, Biff told his grandfather, Buford Tannen, that he wanted to take a "shot" of him, meaning that he wanted to take his picture. Thinking he meant to kill him, Buford shot him with his pistol.
Four hours after he left, Biff reappeared with a bullet hole in his head, as he was shot dead by his own grandfather in 1884. Doc then activated his electrified conducting mat, which electrocuted Biff's gang, preventing them from killing anybody.