Not only should YOU be dictating when she goes out, if she wasn't like this from the start, I'd have to consider whether she has a medical reason for suddenly doing this - much as if she has a UTI going on, I'm not sure why she should be poohing indoors as well. Poohing is rather easier to sort out, provided she doesn't have diarrhoea, because she should only need to have a BM as many times, plus one, as the meals she's eating. In other words if she's having breakfast and a second meal around 5 pm, then she should empty first thing (which will probably be what's left over from yesterday's meals not her breakfast). Then another during the morning and again during the afternoon, or late evening.
I'd suggest she's in pain, and going into a confined space would suggest this - she's trying to get away from the pain. That's one suggestion.
The weaving in and out is odd. Sign of stress? Sign of something else medical (I'm gone to the possibility of a brain tumour).
Whatever the case, we can only guess. Take her to your vet and explain what's been going on so he can examine her, and do what further testing he feels is needed.
For the possibility of a UTI causing her need to pee (lots?) collect a sample of her urine and take it with her when you see your vet. Unfortunately with Rescue dogs, you often inherit what I call 'baggage' and who knows what she had to cope with in the first year of her life.