Do the voltage drop tests outlined by K7LN. Don't start doing all this starter removal, and things like that. If you took 100 "tractor wont start" cases, 99 out of 100 WOULD NOT BE ANYTHING TO DO WITH THE STARTER. The starter is the very LAST thing I would be concerned with. Starters RARELY ever are the problem. AND the fact that the lights go out when you turn the key, tells you IT IS NOT THE STARTER. Get a voltmeter, make the voltage drop tests, it will lead you to the culprit.
Battery cables/connections are about 75 percent of tractor no start problems. Followed by start relays, key switches, safety switches for the remaining 24 percent. and Starters/bendix MAYBE 1 percent. MAYBE. In your case the fact you noticed the lights (and I assume you mean headlights) go out, the battery cables or connections or battery is 100 percent the problem. Screwing around with a starter will NOT fix your tractor. A voltmeter and 2 to 3 minutes of measurements with an assistant WILL fix your tractor.