It all comes down to how the loan itself is structured and reported - the exact details of how they run the loan paperwork, and how/if they report the activity on the loan to one of the credit bureaus (and which one they report to).
It can go generally one of three ways:
A) The loan company reports the status to a credit reporting agency on behalf of both the initiating borrower and the cosigner. In this scenario, both individuals get a new account on their credit report. Initially this will generally drop related credit scores somewhat (it's a "hard pull", new account with zero history, and increased debt), but over time this can have a positive effect on both people's credit rating.
This is the typical scenario one might logically expect to be the norm, and it effects both parties credit just as if they were a sole signor for the loan. And as always, if the loan is not paid properly it will negatively effect both people's credit, and the owner of the loan can choose to come after either or both parties in whatever order they want.
B) The loan company just runs the loan with one person, and only reports to a credit agency on one of you (probably the co-signor), leaving the other as just a backup. If you aren't paying close attention they may even arrange it where the initial party wanting to take the loan isn't even on most of the paperwork. This let the person trying to run the loan get something accepted that might not have been otherwise, or save some time, or was just an error. In this case it will have no effect on Person A's credit. We've had a number of question like this, and this isn't really a rare occurrence. Never assume people selling you things are necessarily accurate or honest - always verify.
C) The loan company just doesn't report the loan at all to a credit agency, or does so incorrectly. They are under no obligation to report to credit agencies, it's strictly up to them. If you don't pay then they can report it as something "in collections". This isn't the typical way of doing business for most places, but some businesses still operate this way, including some places that advertise how doing business with them (paying them grossly inflated interest rates) will "help build your credit". Most advertising fraud goes unpunished.
Note: Under all of the above scenarios, the loan can only effect the credit rating attached to the bureau it is reported to. If the loan is reported to Equifax, it will not help you with a TransUnion or Experian rating at all. Some loans report to multiple credit bureaus, but many don't bother, and credit bureaus don't automatically copy each other. It's important to remember that there isn't so much a thing as a singular "consumer credit rating", as there are "consumer credit ratings" - 3 of them, for most purposes, and they can vary widely depending on your reported histories.
Also, if it is only a short-term loan of 3-6 months then it is unlikely to have a powerful impact on anyone's credit rating. Credit scores are formulas calibrated to care about long-term behavior, where 3 years of perfect credit history is still considered a short period of time and you will be deemed to have a significant risk of default without more data. So don't expect to qualify for a prime-rate mortgage because of a car loan that was paid off in a few months; it might be enough to give you a score if you don't have one, but don't expect much more.
As always, please remember that taking out a loan just to improve credit is almost always a terrible idea. Unless you have a very specific reason with a carefully researched and well-vetted plan that means that it's very important you build credit in this specific way, you should generally focus on establishing credit in ways that don't actually cost you any money at all. Look for no fee credit cards that you pay in full each month, even if you have to start with credit-building secured card plans, and switch to cash-value no-fee rewards cards for a 1-3% if you operate your financial life in a way that this doesn't end up manipulating your purchasing decisions to cost you money.
Words to the wise: "Don't let the credit score tail wag the personal financial dog!"