Query to match ACS data

Table B25081 ACS 2017 5 year survey for the state of Maine indicates that there are 248,675 hhs with a mortgage in Maine. What query would I use in IPUMS USA that would give me that result?

Using IPUMS USA you could either create a data extract or use the online analysis tool (SDA). In either, you will first want to select your sample of interest (in your case, the most recent 5 year ACS sample). For your specific analysis, you will want to choose STATEFIP to help you identify households in Maine and MORTAGE, which will give the mortgage status. You should then weight your analysis using the household weight, HHWT.
These video tutorials can help get you started with the extract system and the online analysis tool. Note that figures from IPUMS USA may not exactly match those in the Census table you are referring to. An explanation as to why can be found in this forum post.