I'm currently a visiting scholar with a small stipend at one institution, but will be there for a short period of half a year only. At the same time, I'm still affiliated to and get a salary from my home institution. I'm actually spending all of my time at the institution where I'm a visiting scholar for the half year period.
Now I'm wondering whether it makes sense to add my visiting scholar affiliation to any papers that I'm submitting during this period? Even though I would have worked (at least partially) on these papers from the visiting scholar affiliation, this affiliation will not persist until such a paper is published, maybe not even until it is being returned with reviews. Instead, I could be using only the affiliation at my home institution, which would be valid for more long-term.
It's conventional in my field (electrical engineering) to use the home affiliation in the "regular" affiliation field, then note the visiting affiliation in a footnote.
e.g. in footnote,
Jane Doe conducted this research while she was a visiting scholar at the Institute for Quantitative Basket Weaving.