A game is first party when it's published by the platform holder, independently if that platform holder owns the IP or not.
Stellar Blade, Helldivers 2, Death Stranding and Uncharted are PlayStation first party games because Sony published them. On PC they are third party because Sony doesn't own PC/Steam.
Demon's Souls, Bloodborne and Death Stranding were published and supported by the XDEV team of Japan Studio. So since they are published by Sony they are first party games.
The Last Guardian was a game internally developed and published by Japan Studio like Knack, Gravity Rush or Astro Bot. Even if around a dozen or so Japan Studio folks (out of over 500 people who worked in the game) left/were fired at the later part of the development and completed their job from GenDesign. It's published by Sony, so it's a first party game.
Hi-Fi Rush is first party on Xbox, third party on PlayStation. Because it's published by the platform holder in Xbox but not in PlayStation.
Owning the IP isn't related to be first party or not. 2nd party games, which also are 1st party games, often use IPs not owned by the platform holder. And there are first party games like Spider-Man 2 or Wolverine, who use licensed IPs not owned by the platform holder.
Who owns the IP is the one who decides if they make ports, sequels, merchandising, adaptations etc. of that IP and who has the last word about it. And gets whatever revenue share generated by these products according to whatever they negogiate in each case.