RAW: It's a bit weird, because tentacles aren't technically in the creature's "square(s)"
By the strictest, "D&D is not a reality simulator" interpretation, the melee characters cannot even hit the Kraken, because it's body (read: its occupied space) is too far away.
But, you have a lot of power (and encouragement) as DM to change creatures as you see fit.
So, given that you've established that PCs can attack the tentacles, the counter question is:
Are you counting the tentacles as individual creatures, or just an in-range part of the whole creature?
If tentacles are a part of the whole creature...
In that case, the rogue gets sneak attack against any tentacle if any enemy of the Kraken is within 5 feet of any part of the Kraken (as well as normal sneak attack circumstances). This includes being adjacent to the same tentacle, other tentacles, the body of the Kraken, etc. You would just treat it as a giant, weirdly shaped, creature.
If the tentacles are separate entities...
In that case, a rogue would only get sneak attack against tentacles which meet the criteria for sneak attack (enemies, advantage against it, etc).
Unfortunately, I don't think there's a lot of RAI advice I can offer here, other than the general Rule-zero type "The DM is the arbiter of the rules and blah blah".
I can, however, offer up how I would handle this based on similar monsters I've used (hydra heads, weird plant creatures with multiple "bodies", etc).
I would treat the entire thing as one creature, but with a caveat: The Tentacles have resistance to most forms of damage. Definitely Piercing, Bludgeoning, and Slashing (from even magical weapons). But probably also Acid, Cold, Fire, Lightning, and Force... MAYBE Radiant and Necrotic. Specifically not Psychic and Poison.
Then give each Tentacle a certain amount of "hp", which is still a part of the Kraken's HP. After a certain amount of damage, that tentacle falls off/disintegrates/whatever. This allows the rogue (fighter/barb/etc) to feel engaged, without feeling neutered and it serves as a visual representation of progress to the party.
This is going to be a tough fight, because of how legendary (heh) the Kraken is. And since "attacking a ship on the surface of the water" probably isn't the Kraken's lair, it's going to retreat before it dies. That was probably your plan all along, but it's worth being a reminder. The ship is saved-ish, the ship crew is alive-ish, and the party can continue along their journey... ish. Now armed with the information as to the general location of a new Kraken Lair that was previously unmarked for some reason.