How to give them credit?
You indicate your affiliation (i. e., the fact that you was a part of a research center / a university and used their resources) while publishing. You may indicate as many affiliations as you wish; I have definitely seen authors with three affiliations.
Do they get benefit from you indicating them as affiliations?
In most cases, they do. A university in my country (Russia) will be ranked higher if its students publish more papers. Both universities and research centers need to show that their students publish papers to justify the use of money they receive through grants. For these purposes, indicating affiliation on a journal paper is usually sufficient. You might want to check with your department to find out if your publication (and you crediting your university in your publication) will benefit them.
How to assign them priority?
This is not something I have seen in affiliations. However, you might wish to expand the Acknowledgments section in your article. Indicate which kind of support you received from each party. Acknowledgments section is also a place to indicate if your work was supported through any grants.