The bow you are speaking of is actually a way dogs show love and respect. Look closely at the context when the dog does it. Animal behaviorists have a name for this bow – I think it is called the “praetorian bow” or something. They tend to do it as a friendly greeting, to show gratitude, or sometimes when they are relaxed or sleepy. But, I believe this is a natural canine behavior and might be something they’d do within the pack. I suspect it relates to Alpha status – that is, they bow to the Alpha or to another member of the pack out of love and respect. For example, my friend’s German Shepherd is OCD obsessed with her ball – in a bad way. The other day I took her ball away from her and gently told her we were done for the day. She did that bow to me. I believe this was gratitude for me relieving her of her “job” (the ball). Unfortunately, I can’t provide more information about this or sources. But, I have heard about it from dog experts over the years. *** Sometimes, but it also can mean they want to go for a walk or want you to play with them. A good belly rub works all the time. It can also be whats known as a calming signal.. It could mean they are uncomfortable. But you need to look at the contexts to be able to conclude on why they are stretching..If say they are lying down and then get up and stretch..they are just stretching..if they are out playing with another dog and stretch it could mean that they are uncomfortable. Sometimes when a dog goes into a forward play bow and maintains that position for more than a few seconds their stomach/bowels may be upset or causing them pain. That position can relieve some of the pressure and lower their discomfort. If you have a dog that does forward bow often and for longer that it would take to stretch, especially after meals, they may have a food allergy to what they are being fed. Or possibly a more serious issue that requires a vet visit/medications.
Source: Are dogs just stretching when they bow forward and backward