[Galaxy Tab S2 General] Tom2112:
There are lots of root and recovery guides here, so why am I posting this? Well, because I tried them, and they either didn't work or were outdated. Also, the install instructions on Lineage OS's site flat out wouldn't work. So here's how I did it!

These instructions are for Windows users, and uses Odin not Heimdall. I'm using Windows 10 Pro. I can't guarantee that it will work on other versions, but I can't see why it wouldn't. YMMV on other versions. I tried Heimdall and no matter what I did, I could not get it to flash anything to my tablet. After much google-fu, I found several people saying Heimdall is broken. I don't know if it is, but it wouldn't work for my on Windows or on Debian linux. So this install uses Odin, which was super easy and I wished I'd have done it in the first place and saved a ton of time and frustration messing around.

For those of you that know what you're doing already, here's the short version:

Enable OEM Unlock in the Developer settings of your stock Samsung OS.

Download TWRP recovery image (the .img.tar version, not the .img version), Lineage OS zip, Lineage Add-on SU zip, Gapps, and Odin (latest versions of all - links are below in the more detailed instructions)

Make sure your stock OS tablet can be seen by your PC - you can copy files back and forth between them. Copy over the Lineage OS, Add-on SU, and Gapps files to your tablet's SD card.

Boot your tablet into Download Mode (Home + Power + Volume Down), tap Vol Up to accept the warning message.

Open Odin on your PC, then plug in your tablet to the PC, note the green COM port number.

Open the Options tab of Odin and make sure the ONLY option checked is the F. Reset Time option. (You don't want it to auto-reboot, and you definitely do NOT want it to re-partition anything).

Click the AP button in Odin and select your TWRP image file. Then click Start in Odin to flash it.

When it's done flashing, disconnect the USB cable from the tablet and exit Download Mode (hold Power + Home + Vol Down), but release them as soon as the screen goes blank and switch to Power + Home + Volume Up so that it boots into recovery. If you miss it, booting into the stock OS will wipe out the TWRP recovery and you'll have to flash it again with Odin.

Once in TWRP recovery, flash the lineage OS file, the add-on-su file, and the gapps file. If asked about encryption, go ahead and tell it to wipe everything out. It's going to wipe your data partition anyway, and if you don't it will screw things up and you'll end up locking TWRP out of the data partition. This can be resolved by rebooting into Recovery and using TWRP to wipe the data partition and then flashing the lineage OS, add-on, and gapps files again.

Once you've flashed lineage OS, add-on-su, and gapps, go ahead and use the on-screen option to wipe the cache and davlik partitions, then reboot into the system.

The first boot will take some time, so go get a beer/coffee/soda and relax. Once it is booted up, it will take you through the Lineage OS setup.

After you complete the setup, you can enable Root on this device by going into Developer Options (under Settings > System > Advanced > Developer Options) and tapping Root Access and selecting from Disabled, Apps Only, ADB Only, Apps and ADB options.

Notes (lessons learned):

Don't flash any of Chainfire's SuperSU packages. They won't work with Lineage OS and will goober up the add-on-su package install. I had to wipe my device and reinstall Lineage from scratch (with the add-on-su and not Chainfire's SuperSU) before mine would work.

Also, I ran into trouble with the encryption of the Data partition. I can't remember the exact sequence of events, but there was a selection when I was installing Lineage for the first time about the encryption of the partition, and apparently I chose wrong. The OS didn't install, it didn't boot right, and TWRP refused to mount the Data partition. I had to reboot into recovery (from recovery) and use TWRP to wipe the Data partition, then reflash lineage OS, add-on-su, and gapps. Then it worked fine.

The LONG Version (more detailed instructions):

Step 1) Gather the files you'll need:

Go to lineage's site and grab the latest OS version. Currently that's v16.0 (Android v9.0 Pie)

https://download.lineageos.org/gts28vewifi​

Go to lineage's site and grab the add-on-SU package. Get the arm64 one (second from the top) named addonsu-16.0-arm64-signed.zip

https://download.lineageos.org/extras​

Go to Team Win's site and download the twrp package for the Samsung Galaxy Tab S2 8.0 (known as "gts28vewifi" on most of these sites). Be sure to grab the .img.tar version of the file, NOT the .img version.

https://dl.twrp.me/gts28vewifi/​

Go to the Odin website and download the latest version of Odin. (At the time of this writing, it is v3.13.1) Note there are links there for multiple versions. I used v3.12.3, but v3.13.1 will work too.

https://odindownload.com/​

Go to the OpenGapps.org site and grab the nano version of Gapps. Be sure to select ARM64 for the platform, v9.0 for the Android version, and nano for the variant. (You can choose any variant you like. I used nano. If you know what you're choosing, go for it.)

https://opengapps.org/​

Step 2) Enable OEM Unlock on your tablet

On your tablet, go into the Developer settings and enable OEM Unlock. (If you don't have Developer settings in your Settings menu, go to About Tablet and tap the Build Number several times in a row. (As you tap it, it will countdown the number of taps until Developer mode is turned on. Once you've tapped it seven or so times, you can go back to the Settings menu and there will be a new entry there Developer settings. The OEM Unlock is in there, enable it.

Also, back up your tablet contents, because this will wipe your tablet's internal storage (not your SD card though). How you backup is up to you and beyond the scope of this post.

Step 3) Get a good quality/reliable USB-to-micro-USB cable (one came with your tablet).

Using a cheap cable will cause you headaches, and you don't won't to be flashing your recovery partition using a lousy cable.

Step4) Copy the needed files to your tablet's SD card.

In my case, those files were:

lineage-16.0-20190523-nightly-gts28vewifi-signed.zip (517MB)

addonsu-15.1-arm64-signed.zip (1MB)

open_gapps-arm64-9.0-nano-20190529.zip (175MB)​

Do not copy it to the tablet's internal storage, as that's gonna get wiped out. You can make a new folder on the SD card or just put it in the root of the card. The simplest way to do this is to have your tablet powered up under the original factory OS and just plug it into your PC with the USB-to-micro-USB cable. It will appear in Windows as a device with two "folders" in it - one for internal storage and one for the SD card. Just drag and drop the files over.

Step 5) Let's flash that recovery! (this is the tricky part):

Make sure your tablet has at least 75% charge before you begin this step. If it doesn't charge it until it does.

Disconnect your tablet from your PC. (unplug the USB cable)

Unzip Odin to a folder - it doesn't really matter where, I put mine on my Desktop. It is handy if you copy the twrp .img.tar file into the Odin folder, but not necessary. When I started Odin, I right-clicked on it and clicked Run As Administrator, then clicked Yes to the windows pop-up. I probably did NOT need to do this, but I didn't want anything getting in the way when it came time to flash the recovery partition of my tablet.

With Odin open, you'll notice that all the blocks across the top are greyed out and blank. That's good because we haven't done anything yet. Notice the left-most small grey block has ID:COM written above it. When you plug in your tablet, it will show what COM port your tablet is on.

Before you plug in your tablet, you need to boot it into Download Mode. To do so, power off the tablet. Then hold the Home button, the Volume Down button, and the Power button at the same time. Within a few seconds, it will boot into a light blue screen that warns you about the dangers you are about to embark upon. Let go of the three buttons you're holding and tap the Volume Up button to let it know that you've got this and you're gonna make this tablet submit to your will! Once you press the Volume Up button, it will go to another light blue screen that says Download and has a message about not turning off the device.

Once you're at that light blue Download screen, you can plug your tablet into your PC with the USB cable. Almost immediately, the ID:COM box should turn green and show a com port number, such as COM4. If you don't get anything give it a minute. If nothing happens, then you may need to install drivers for your tablet. The easy way to do that is to install Samsung's official PC application. It used to be Kies, but now it is called Smart Switch. You can download it here:

https://www.samsung.com/us/support/owners/app/smart-switch

If you need to install Smart Switch, close Odin and unplug the USB from your tablet. Take the tablet out of Download Mode while you take care of business installing Smart Switch. To get the tablet out of Download Mode hold the Home, Volume Down, and Power buttons at the same time for about 10 seconds. When the light blue screen goes away release the buttons or you'll end up back in Download Mode.

After installing Smart Switch, plug in your tablet via USB (make sure it is booted up in the stock OS, not in Download Mode) and make sure your PC detects the tablet and that you can copy files to/from the tablet. When it does, you're ready to disconnect the USB to the tablet and boot the tablet into Download Mode again. Then start Odin, then plug in the USB to the tablet and see if you get a nice green com port showing.

Now that you've got Odin running, the tablet connected, and the com port showing green, you're ready to flash TWRP. Click the AP button in Odin, which will open a standard Windows open-a-file window. Navigate to where you saved the twrp .img.tar file (in my case it was named twrp-3.3.1-0-gts28vewifi.img.tar). Select that file and click OK. Now the Odin window will show the location/filename of your twrp file next to the AP button.

On the left side of the Odin window, click on the Options tab. By default the Auto Reboot and F. Reset Time options will be checked. Uncheck the Auto Reboot option and MAKE SURE THE F. RESET TIME OPTION IS THE ONLY OPTION CHECKED!

Now you're ready to click the Start button which is what flashes the TWRP recovery to your tablet. Go ahead and click Start. The flash will take about 20 seconds or so, and when it is done, the grey blocks above the ID:COM block will be green and will say PASS and have a time under it. (It might have said OK instead of PASS, I can't remember now...) Anyway, you'll know it was OK because its green. If the flash did not work, it will be red and say FAIL! If it fails, make sure you specified the twrp .img.tar file with the AP button and NOT a twrp .img file. (common mistake - .img.tar files are for Odin and .img files are for Heimdall) You can also try rebooting your tablet back into Download Mode, and make sure it is seen by Odin (Odin shows the com port in green).

Assuming that Odin is green and OK, you're ready to unplug the tablet from the PC.

The next step is a little tricky so get your head right before you do it. You're going to reboot the tablet out of Download Mode and directly into Recovery. It is important that you do NOT allow the tablet to boot as normal into the OS. (That's because the stock OS will see that your recovery partition has been changed and it will change it back to the stock recovery and you'd have to start over and flash twrp again.). To make this happen correctly you have to hold the Home + Power +Volume Down at the same time, BUT as soon as the light blue screen goes away, let all three go, then hold Home + Power + Volume Up! So you're basically switching one finger from Volume Down to Volume Up. It may sound tricky, but it really isn't. Just be sure to switch as soon as the light blue screen goes away. Worst case, you miss it and it boots back into the factory OS and you have to do this whole step over again.

Step 6) Time to flash the OS and other goodies!

Once you completed the above step and successfully booted into TWRP recovery, you've completed the tricky parts. The rest is rather simple and done entirely on the tablet.

In TWRP Recovery tap the Install button. Tap the Select Storage button at the bottom. Select MicroSD from the list and tap OK. Now use the folder structure on-screen to navigate to where you saved the lineage OS, add-on-su, and gapps files. If you're smart, you saved them to the root of the SD card and they're already listed on the screen. Tap the Lineage OS file first (in my case it was the lineage-16.0-20190523-nightly-gts28vewifi-signed.zip file). The screen will change and have an Add More Zips button, tap it. Tap the add-on-su file (addonsu-15.1-arm64-signed.zip) and tap Add More Zips, and tap the Gapps file (open_gapps-arm64-9.0-nano-20190529.zip). Now you're ready to flash, so swipe the bar at the bottom to the right. It will start the flash and this will take a few minutes.

Now, I apologize for this next part, I didn't write down exactly what happened... but the gist of it is: the Data partition of my tablet was encrypted (according to TWRP, I hadn't encrypted it via the stock OS), and that messed up the flash. TWRP asked me about the encryption but I was unclear what option to pick. Obviously I picked wrong, because the result was that the flash didn't work, and the Data partition of my tablet was unwritable/unmountable for TWRP and the process blew a bunch of errors. The good part is that the fix was simple. I rebooted from TWRP back into TWRP (tap Reboot then tap Recovery). After rebooting back into TWRP, I tapped Wipe, then Advanced Wipe, checked the Data partition and swiped right. It wiped the encrypted Data partition, and I flashed the lineago OS, add-on-su, and gapps files again. That time it went perfectly. So, if you're reading this now, you may just want to save yourself a little bit of time and before you try to flash the first time, wipe the Data partition. Warning: there's no going back from this, your Data partition will be blank, so be sure to have backed it up before you started down this road, or be ready to proceed with flashing Lineage OS and don't look back.​

When the flash process is complete (and error free), go ahead and tap the option to wipe your cache and davlik partitions, then reboot. Both options are on the screen that shows right after the flash process.

Step 7) Let it boot into Lineage OS and enable Root (or not)!

The first boot will take some time, so go get a drink and be patient. It didn't take a whole 10 minutes, but it seemed like it. Once it boots, it will take you through the Lineage/Android setup process. Go ahead through that, then if you want Root, go to Settings > About Tablet and tap the build number seven times, it will do a countdown as you tap to turn on Developer Mode. Hit the back button, tap System > Advanced > Developer Options and scroll down until you find Root Access. Tap it and select from the options: Disabled, Apps Only, ADB Only, Apps and ADB. I suggest Apps Only, as I don't need ADB. YMMV. You now have a rooted Samsung Galaxt Tab S2 with Lineage OS and TWRP. Congrats!