Harbour

At the harbour, you can fish around for more clues. Crack the code and the grid will reveal where the lighthouse key has been hidden. Maybe you’ll find the legendary Gold of Morwenna before Orville Blackbeard gets his hands on it. Don’t forget to collect your final rune.

Look at the first two lines. A number can't be both in the correct place and the incorrect place at the same time. That digit is not part of the code.
Why not jump to the fourth line? If none of the digits are correct, you can discount them completely. That should help you position the digits remaining in the first and final lines.
When you have cracked the code, look for the digit in the number grid. The first grid corresponds with the first digit in the code. Trace that digit to reveal a letter. What do the three letters spell?
The three-digit code is 8 7 4. If you trace all of the 8s in the first grid, all of the 7s in the second grid, and all of the 4s in the third grid, it reveals the letters: hut