The Unintentional Time Traveler, by Everett Maroon
Fifteen-year-old Jack Bishop has mad skills with cars and engines, but knows he’ll never get a driver’s license because of his epilepsy. Agreeing to participate in an experimental clinical trial to find new treatments for his disease, he finds himself in a completely different body—that of a girl his age, Jacqueline, who defies the expectations of her era. Since his seizures usually give him spazzed out visions, Jack presumes this is a hallucination. Feeling fearless, he steals a horse, expecting that at any moment he’ll wake back up in the clinical trial lab. When that doesn't happen, Jacqueline falls unexpectedly in love, even as the town in the past becomes swallowed in a fight for its survival. Jack/Jacqueline is caught between two lives and epochs, and must find a way to save everyone around him as well as himself. And all the while, he is losing time, even if he is getting out of algebra class.