If I overstay my VWP stay by let's say 2 weeks and then my USC wife puts in an adjustment of status and request for my green card, and months later after the interview it gets refused, how long is my overstay then?

Is it 2 weeks? Is it all the days since my stay expired until the day my green card is refused?

It's confusing because some people say I have a legal status during my AOS and no days count towards my ban during that, but I read also if it gets denied then yes they will count.