What if we have been praying salat wrong unintentionally throughout our lives and don't know it. I've heard that Allah Almighty also gives importance to niyah. So in the following case because of our niyah to perform salat and because of not doing it intentionally will we be forgiven. Because I have heard from an elder that it might be very difficult that we are praying the correct way and many people pray in different ways according to their beliefs so Allah looks at our niyah of performing salat instead of the method
Performance and Niah are both important to be done properly and cannot cover for each other. But ignorance is negligible and you can correct yourself as soon as you discover the fault, and move on accordingly.