Anita , it’s a funny thing to me that so many want to befriend locals , but in their own towns at home they don’t really befriend tourists ! Sure you may chat to them if sitting beside them at a cafe , but have you ever invited any home ? Met them later for dinner ? Maybe you have , some folks are more open , but most locals have their own family and friends to interact with , and are busy with work and school ( kids ) etc . So I think the best one can hope for is some friendly interaction , like chatting briefly with a shop keeper , the people at table next to you , someone in line up near you etc .
Just being open to chat is all I can suggest , I’ve been lucky over the decades of travel , but I can’t say I’ve actually made friends as much as we’ve been friendly and had friendly interactions .
Three weeks is t very long , that’s about a week in each place right ? Just go and enjoy yourself .
Ps If you had more time ( a month or two) you could look at WOOFING . My nieces and daughter have done that and it’s a much better way of actually getting to know locals .