Not a big fan of TL;DR explanations of burning sticks that have NOT_A_FRACKING_THING to do with the question. Swim bladders, if the leviathan was a big fish, would answer the first part of your question. https://en.wikipedia.org/wiki/Swim_bladder. How do you control it? Well, that's an enormous problem (no pun intended). Generally, domestication benefits the animal by easier food access, protection from predators, and shelter and so, increased chances of reproduction. So, even if you could send electrical signals to its brain or fins to change direction, unless those changes led it to food or a mate (or perhaps "nicer" water, whatever that means), then you'd be fighting it every step of the way (every stroke of the way). You need to be able to train it to tolerate you and have a reason to obey your commands. Maybe it needs a hard to find nutrient, which you can provide for it, for example. As far as a system of vision, I see no way. 671
If you could keep it on the surface, then a system of tubes and mirrors might be created (Middle Ages are ~1000 years, you do understand that, right? Mirrored glass was available by 1300 CE, and even before that polished metal could have been used. A system of levers, pulleys, gears, etc. to keep the optical path from the surface to the observer could be possible, but probably would require magical surgery to install (and keep antiseptic). How would you keep it on the surface? By definition, a leviathan is a deep water beast. So, you'd need for it to be smart enough to follow directions and the problem with that is, that in an ocean, asking for it to travel between points A and B on a map would be like asking a 18th Century wagon driver to plot a trajectory between Earth and Mars - not at all plausible. So, what could you do? Say it can sense magnetic fields, so it can travel N,S,W,E, etc. You'd need to surface to locate using an astrolabe, because currents would make it difficult to determine speed (hence how long to keep to a heading). Smells and sounds might help it recognize where it is, if it had been there before. And of course, perhaps it could follow a ship, assuming the ship made distinguishable sounds... 302