You have to complete the heist while all three other teammates are in custody. If one of your teammates is still in bleedout when you finish the heist then the trophy won't be unlocked.
Make sure that the 'Play with team AI' option is enabled so even if a player leaves the heist, an AI-controlled teammate will take the spot.
To get this in single-player mode with only AI-controlled teammates, you can play on hard or overkill difficulties so the AI dies easier. Make sure that you are at the end of the heist before letting your AI be caught into custody since it's harder to survive the heist alone. When an AI is in bleedout then the other AI-controlled teammates will try to save him. You can repeatedly press the button to call them towards you so they don't save the fallen teammate.