I had a creaking crank once. Only when pedalling and did it both in and out of the saddle.
Pulled the crank and BB, meticulously cleaned and greased the BB threads. Reinstalled it. Still there.
Pulled the pedals, meticulously cleaned and greased the threads. Reinstalled them. Still there. Tried new pedals. Still there.
Pulled the chainrings, meticulously cleaned them and the interfaces on the cranks and greased the bolts. Reinstalled them. Still there.
Pulled the seat and seat post, despite the noise being there when out of the saddle. Meticulously cleaned and greased the post and inside the seat tube, tried a different saddle. Still there.
Pulled the rear shock and cycled through the travel without the shock in place. Nope, not the pivots.
Cleaned and greased the shock mounts. Noise still there.
There was a removable brace across the seat stays. I had mounted a P-clip to one of the bolts to neaten the rear brake hose. Removed the P clip, removed, cleaned, greased and reinstalled the brace. Still there.
Tightened the rear QR skewer, noise stopped...
...only to be replaced by the noise of sobbing over the fact that I just rebuilt half the damn bike for the sake of a 5 second fix.