Installing outdoor unit in crawl space

I have read that the outdoor units need to be sheltered from rain and snow and I’ve seen people install the outdoor units inside shops.

I am putting one in a large room above my garage that has crawl spaces on both sides of the 40ft stretch of the room. Can I put the outdoor unit in the crawl space and run the drain line outside?

Has anyone done this?